do we already have sum-modulo-10 algo (aka Luhn's algo) on phobos ?

jfondren julian.fondren at gmail.com
Sat Jul 3 17:51:59 UTC 2021


On Saturday, 3 July 2021 at 17:44:48 UTC, someone wrote:
> https://en.wikipedia.org/wiki/Luhn_algorithm#Pseudocode_implementation

That specific function, in Phobos? no.

sum modulo 10? That's just some_var%10 in D.

The Wikipedia link ends with a link to RosettaCode:

https://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers#D
... this is a pretty nice RC entry, translating Haskell, C, and 
SPARK
all into D. Really shows off D's range of expression.


More information about the Digitalmars-d-learn mailing list