Talk:Luhn algorithm: Difference between revisions

Content deleted Content added
Tzadikv (talk | contribs)
Tags: Mobile edit Mobile web edit New topic
Line 327:
:I think you've misread the formula: it's using the "ceiling" operator rather than square brackets. If s=67, then <math>\lceil s/10\rceil = \lceil 6.7\rceil = 7</math>. So the full equation evaluates to 3.
:The first equation <math>10 - (s\operatorname{mod} 10)</math> does look wrong though, since it'd result in 10 rather than 0 if s is a multiple of 10. [[User:JamesHenstridge|James]] ([[User talk:JamesHenstridge|talk]]) 10:54, 4 July 2023 (UTC)
 
== Unnecessarily complex implementations ==
 
Why do all these implementations do the unnecessary steps of separating the check digit from the payload, subtracting the weighted payload sum from 10 and comparing it with the check digit?
 
All you have to do is leave the check digit as part of the payload, weight that position as 1, mod the the whole sum by 10 and compare it to 0. [[User:Tzadikv|Tzadik]] ([[User talk:Tzadikv|talk]]) 12:13, 4 January 2024 (UTC)