Make GpuUInt128 mutable and update callers
This commit is contained in:
1 parent
40477eca5d
commit
ab856c4995
6 files changed
+267
-203
No files matched your search
@@ -13,7 +13,17 @@ public class GpuUInt128Pow2Minus1ModTests
|
||||
ulong exponent = 23UL;
|
||||
GpuUInt128 modulus = new(0UL, 97UL);
|
||||
var pow = GpuUInt128.Pow2Mod(exponent, modulus);
|
||||
var expected = pow.IsZero ? modulus.Sub(GpuUInt128.One) : pow.Sub(GpuUInt128.One);
|
||||
GpuUInt128 expected;
|
||||
if (pow.IsZero)
|
||||
{
|
||||
expected = modulus;
|
||||
expected.Sub(GpuUInt128.One);
|
||||
}
|
||||
else
|
||||
{
|
||||
expected = pow;
|
||||
expected.Sub(GpuUInt128.One);
|
||||
}
|
||||
var actual = GpuUInt128.Pow2Minus1Mod(exponent, modulus);
|
||||
actual.Should().Be(expected);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user