% 10 operations replaces with UInt128/ulong.Mod10 methods
This commit is contained in:
1 parent
3e0102a404
commit
412ce4fd50
13 files changed
+256
-195
No files matched your search
@@ -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)]
|
||||
|
||||
Reference in new issue
Block a user