Merge pull request #6734 from mohamed6000/shortest-round-error

Fixed the upper bound of Decimal in round_shortest
This commit is contained in:
gingerBill
2026-05-26 11:23:12 +01:00
committed by GitHub

View File

@@ -281,7 +281,7 @@ round_shortest :: proc(d: ^decimal.Decimal, mant: u64, exp: int, flt: ^Float_Inf
}
upper_: decimal.Decimal; upper := &upper_
decimal.assign(upper, 2*mant - 1)
decimal.assign(upper, 2*mant + 1)
decimal.shift(upper, exp - int(flt.mantbits) - 1)
mantlo: u64