Luhn algorithm: Difference between revisions

Content deleted Content added
m revert - text states check digit is excluded at this point
Fix missing mod 10 at then end
Line 81:
The sum of the resulting digits is 56.
 
The check digit is equal to <math>(10 - (56\operatorname{mod} 10) \operatorname{mod} 10) = 4</math>.
 
This makes the full account number read 17893729974.
Line 133:
};
 
return (10 - (check_digit % 10)) % 10 == digits.Last();
}
</syntaxhighlight>