Skip to content

invalid interval constructed #718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lucaferranti opened this issue May 17, 2025 · 0 comments
Open

invalid interval constructed #718

lucaferranti opened this issue May 17, 2025 · 0 comments

Comments

@lucaferranti
Copy link
Member

This is because of this issue in julia: JuliaLang/julia#58432

TL;DR: converting a rational to BigFloat, especially when rounding up or down, has some correctness issues, see code snippet and problem diagnostic in the linked issue

Because of that, sometimes invalid intervals can be constructed

julia> a = 1 // (big(2)^300 + 1)
1//2037035976334486086268445688409378161051468393665936250636140449354381299763336706183397377

julia> aa = interval(BigFloat, a, a)
[4.90909e-91, 4.9091e-91]₂₅₆_com

julia> inf(aa) > sup(aa)
true

julia> interval(inf(aa), sup(aa))
┌ Warning: ill-formed interval [a, b] with a = 4.909093465297726553095771954986275642975215512499449565111549117187105254721716e-91, b = 4.909093465297726553095771954986275642975215512499449565111549117187105254721673e-91 and decoration d = com. NaI is returned
└ @ IntervalArithmetic ~/.julia/packages/IntervalArithmetic/uYe1Q/src/intervals/construction.jl:443
∅₂₅₆_ill

I was expecting the aa construction to return NaI because of the issue in Julia, but it actually silently returns an invalid interval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant