Jump to content

ISBN13 check digit: Difference between revisions

(→‎{{header|langur}}: added langur 0.7.1 example)
Line 188:
=={{header|langur}}==
{{works with|langur|0.7.1}}
<lang langur>val .isbn13checkdigit = f(var .ns) {
valmatching(re/^[0-9]{13}$/, .s = replace (.ns, RE/[\- ]/)) and
matching(re/^[0-9]{13}$/, .s) and
fold(f{+}, map([_, f .d x 3], map(f .c-'0', s2cp .s))) rem 10 == 0
}
1,007

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.