JuliaIntervals / IntervalArithmetic.jl

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

Define `x // 3` for an interval `x` #670

Closed dpsanders closed 1 month ago

dpsanders commented 1 month ago
ff(x) = x // 3

ff(1..2)

gives

ERROR: MethodError: no method matching //(::Interval{Float64}, ::Int64)
dpsanders commented 1 month ago

Similarly for

ff(x) = x // interval(3)
OlivierHnt commented 1 month ago

This was done on purpose because // is a constructor for the Rational type.

This is consistent with eg

julia> 1.0//1
ERROR: MethodError: no method matching //(::Float64, ::Int64)