Fixed the upper bound of Decimal in round_shortest

This commit is contained in:
mohamed6000
2026-05-25 16:21:00 +01:00
parent 89c71c920f
commit 5c485d26ee

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