DoubleDouble.jl icon indicating copy to clipboard operation
DoubleDouble.jl copied to clipboard

ERROR: <= not defined for DoubleDouble.Double{Float64}

Open dpo opened this issue 7 years ago • 0 comments

I thought <= might have been inferred from < and == but apparently, that's not the case:

julia> a = Double(1.0);

julia> b = Double(2);

julia> a < b
true

julia> a == b
false

julia> a ≤ b
ERROR: <= not defined for DoubleDouble.Double{Float64}
Stacktrace:
 [1] <=(::DoubleDouble.Double{Float64}, ::DoubleDouble.Double{Float64}) at ./promotion.jl:351

It seems to be a matter of

julia> import Base.≤

julia> ≤{T}(x::Double{T}, y::Double{T}) = x < y || x == y
<= (generic function with 58 methods)

dpo avatar Jul 22 '17 22:07 dpo