% 10 operations replaces with UInt128/ulong.Mod10 methods

This commit is contained in:
Marek Lemańczyk committed 2025-09-21 07:42:25 +02:00
1 parent 3e0102a404
commit 412ce4fd50
13 files changed
+256 -195

No files matched your search

+2 -2
View File
@@ -215,11 +215,11 @@ public static class UInt128Extensions
while (high != zero)
{
// 2^64 ≡ 6 (mod 10)
result = (result + (ulong)high * 6UL) % 10UL;
result = (result + (ulong)high * 6UL).Mod10();
high >>= 64;
}
return result % 10UL;
return result.Mod10();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]