checkdigit calculation for HP-17b
|
07-29-2015, 01:52 AM
Post: #22
|
|||
|
|||
RE: checkdigit calculation for HP-17b
(07-28-2015 09:51 PM)Gerson W. Barbosa Wrote: I wonder why they use a somewhat more complicate method here, that is, multiplications of the sums by 10 being required before the final mod 11 operation These lines: Code: for (i=1; i<=9; i++) \(\cdots\) could be replaced by: Code: for (i=1; i<=9; i++) Quote:not to mention the appending of the first checking digit to the number before computing the second checking digit. These lines: Code: for (i = 1; i <= 10; i++) \(\cdots\) could be replaced by: Code: for (i = 1; i <= 9; i++) This looks like duplicated code that could be extracted to a separate function. Cheers Thomas |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)