Merge pull request #2 from mlemanczyk/codex/fix-failing-gpuuint128-tests
Fix borrow handling in GpuUInt128 subtraction
This commit is contained in:
1 file changed
+1
-1
@@ -246,7 +246,7 @@ public readonly struct GpuUInt128 : IComparable<GpuUInt128>, IEquatable<GpuUInt1
|
||||
public GpuUInt128 Sub(GpuUInt128 other)
|
||||
{
|
||||
ulong borrow = Low < other.Low ? 1UL : 0UL;
|
||||
return new(High - other.High + borrow, Low - other.Low);
|
||||
return new(High - other.High - borrow, Low - other.Low);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
|
||||
Reference in new issue
Block a user