Post Reply 
checkdigit calculation for HP-17b
07-29-2015, 02:20 AM
Post: #23
RE: checkdigit calculation for HP-17b
(07-28-2015 10:11 PM)Don Shepherd Wrote:  What you did would have never occurred to me because I would have wanted to avoid negative numbers

And that's why you used -9 in your formula?
Nah, just kidding. Of course I understand what you mean. Smile

Once you're familiar with the rules of modular arithmetic, you can juggle with the expressions in new ways.

Examples modulo 11:
(stolen from my previous answer to Gerson's question)

Code:
10 * (11 - i)
-1 * (0 - i)
i

Code:
10 * (12 - i)
-1 * (1 - i)
i - 1

Kind regards
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: checkdigit calculation for HP-17b - Thomas Klemm - 07-29-2015 02:20 AM



User(s) browsing this thread: 1 Guest(s)