Skip to content

invalid interval constructed #718

@lucaferranti

Description

@lucaferranti

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions