JuliaIntervals / IntervalArithmetic.jl

Library for validated numerics using interval arithmetic
https://juliaintervals.github.io/IntervalArithmetic.jl/
Other
290 stars 70 forks source link

Extend `ExactReal` to work with `BareInterval` #648

Closed OlivierHnt closed 2 months ago

OlivierHnt commented 2 months ago

This PR allows @exact to work with BareInterval, eg

julia> @exact bareinterval(3, 4) ^ 2
BareInterval{Float64}(9.0, 16.0)

I think this PR also addresses the concerns raised in #646.

Closes #646.

dpsanders commented 2 months ago

Thanks! I think there's a promotion rule missing. Also please add a test :)

julia> promote(bareinterval(1, 2), ExactReal(3))
ERROR: promotion of types BareInterval{Float64} and ExactReal{Int64} failed to change any arguments
OlivierHnt commented 2 months ago

Indeed thanks 🙂