Fix subtraction borrow in GpuUInt128
This commit is contained in:
1 parent
15e84d5845
commit
595f6129b6
1 file changed
+1
-1
@@ -246,7 +246,7 @@ public readonly struct GpuUInt128 : IComparable<GpuUInt128>, IEquatable<GpuUInt1
|
|||||||
public GpuUInt128 Sub(GpuUInt128 other)
|
public GpuUInt128 Sub(GpuUInt128 other)
|
||||||
{
|
{
|
||||||
ulong borrow = Low < other.Low ? 1UL : 0UL;
|
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)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
|||||||
Reference in new issue
Block a user