Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
ISBN
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===ISBN-10 check digit calculation=== <!-- "Damm algorithm" links here --> Each of the first nine digits of the 10-digit ISBN—excluding the check digit itself—is multiplied by its (integer) weight, descending from 10 to 2, and the sum of these nine products found. The value of the check digit is simply the one number between 0 and 10 which, when added to this sum, means the total is a multiple of 11. For example, the check digit for an ISBN-10 of 0-306-40615-''?'' is calculated as follows: {{block indent|<math> \begin{align} s &= (0\times 10)+(3\times 9)+(0\times 8)+(6\times 7)+(4\times 6)+(0\times 5)+(6\times 4)+(1\times 3)+(5\times 2)\\ &= 130. \end{align} </math>}} Adding 2 to 130 gives a multiple of 11 (because 132 = 12×11)—this is the only number between 0 and 10 which does so. Therefore, the check digit has to be 2, and the complete sequence is <nowiki>ISBN 0-306-40615-2</nowiki>. If the value of <math>x_{10}</math> required to satisfy this condition is 10, then an 'X' should be used. Alternatively, [[modular arithmetic]] is convenient for calculating the check digit using modulus 11. The [[remainder]] of this sum when it is divided by 11 (i.e. its value modulo 11), is computed. This remainder plus the check digit must equal either 0 or 11. Therefore, the check digit is (11 minus the remainder of the sum of the products modulo 11) modulo 11. Taking the remainder modulo 11 a second time accounts for the possibility that the first remainder is 0. Without the second modulo operation, the calculation could result in a check digit value of {{nobr|11 − 0 {{=}} 11}}, which is invalid. (Strictly speaking, the ''first'' "modulo 11" is not needed, but it may be considered to simplify the calculation.) For example, the check digit for the <nowiki>ISBN</nowiki> of 0-306-40615-''?'' is calculated as follows: {{block indent|<math> \begin{align} s &= (11 - ( ( (0\times 10)+(3\times 9)+(0\times 8)+(6\times 7)+(4\times 6)+(0\times 5)+(6\times 4)+(1\times 3)+(5\times 2) ) \,\bmod\, 11 ) ) \,\bmod\, 11\\ &= (11 - ( (0 + 27 + 0 + 42 + 24 + 0 + 24 + 3 + 10 ) \,\bmod\, 11) ) \,\bmod\, 11\\ &= (11-((130) \,\bmod\, 11))\,\bmod\, 11 \\ &= (11-(9))\,\bmod\, 11 \\ &= 2\,\bmod\, 11 \\ &= 2 \end{align} </math>}} Thus the check digit is 2. It is possible to avoid the multiplications in a software implementation by using two accumulators. Repeatedly adding <code>t</code> into <code>s</code> computes the necessary multiples: <syntaxhighlight lang="C"> // Returns ISBN error syndrome, zero for a valid ISBN, non-zero for an invalid one. // digits[i] must be between 0 and 10. int CheckISBN(int const digits[10]) { int i, s = 0, t = 0; for (i = 0; i < 10; ++i) { t += digits[i]; s += t; } return s % 11; } </syntaxhighlight> The modular reduction can be done once at the end, as shown above (in which case <code>s</code> could hold a value as large as 496, for the invalid <nowiki>ISBN 99999-999-9-X</nowiki>), or <code>s</code> and <code>t</code> could be reduced by a conditional subtract after each addition.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
ISBN
(section)
Add topic