Hacker News new | ask | show | jobs
by nookiemonster 4838 days ago
Increment is the wrong word. They implemented the Luhn algorithm, which is not the same as i++
1 comments

Increment in the general sense just means to increase the amount. A more specific meaning is to increase using regular steps, that is, to select the next number in a sequence. The use of the word is not confined to i++ or i=i+1 or ++i.

Luhn is just a check digit, so you could define an increment function that adds one to the base number and then calculates the last digit. Or, you could just iterate over every possible check digit from 0-9.