You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Uncertain decimal literal 0.03?3 loses its exact zero endpoint #785
Parsing 0.03?3 gives a positive lower endpoint instead of [0, 3/50]. I"0.03?3" gives the same bounds.
Version: IntervalArithmetic.jl 1.0.12, 8453a776432fbdde32a9edc3cb15da82eb9b3418, Julia 1.10.10 and 1.12.7, Linux 6.17.0-1020-oracle x86_64.
Both forms give these bounds on both Julia versions at default precision: Float64 endpoints, 256-bit BigFloat. Run in a fresh directory with Julia 1.10.10 on PATH:
Actual: (2.698802673467014e-79, 0.060000000000000005). The assertion fails. Control: (0.0, 0.060000000000000005).
The parser contract requires tight enclosure and defines uncertainty in last-digit units. 3/100 ± 3/100 requires Float64 bounds (0.0, 0.060000000000000005).
The uncertain branch appears to round midpoint and decimal unit separately in BigFloat before subtracting and converting outward.
Related IEEE Std 1788-2015 clauses: 12.11.1, 12.11.3 (uncertain form (c)), 12.12.7. We rely on the package contract because the published IEEE body was unavailable.
It feels like such parsing is a good use case for Rational, as everything involved here is exactly representable as Rational e.g. "0.03?3" has the form 3//100 +- 3 * 1//100. That way, the question of rounding is solved, and it just need to be applied at the last step to convert to Float64.
Activity
Kolaru commentedon Oct 14, 2026
Yep, that's a bug.
It feels like such parsing is a good use case for Rational, as everything involved here is exactly representable as Rational e.g.
"0.03?3"has the form3//100 +- 3 * 1//100. That way, the question of rounding is solved, and it just need to be applied at the last step to convert to Float64.