Fix subtraction borrow in GpuUInt128

This commit is contained in:
Marek Lemańczyk committed 2025-09-09 22:22:23 +02:00
1 parent 15e84d5845
commit 595f6129b6
1 file changed
+1 -1
+1 -1
View File
@@ -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)]