3 ms·
Increment is the wrong word. They implemented the Luhn algorithm, which is not the same as i++
by nookiemonster 14y ago
Increment is the wrong word. They implemented the Luhn algorithm, which is not the same as i++
- antiterra 14y agoIncrement 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.