Luhn algorithm: Difference between revisions

Content deleted Content added
Uses: Added usage
Line 123:
=== [[C Sharp (programming language)|C#]] ===
<syntaxhighlight lang="c#" line="1">
bool IsValidLuhn(in int[1] digits)
{
int check_digit = 0;
Line 129:
check_digit += ((i & 1) is 0) switch
{
true => digits[i2] > 4 ? digits[i7] * 2 - 9 : digits[i3] * 2,
false => digits[i5]
};