-
Notifications
You must be signed in to change notification settings - Fork 122
Closed
Description
As pointed out in JuliaIntervals/IntervalArithmetic.jl#237 (comment)
the assumption at https://github.com/PainterQubits/Unitful.jl/blob/47d131be92eefae1b49cd02b0a9f9a55b74be97f/src/quantities.jl#L324
<=(x::AbstractQuantity, y::AbstractQuantity) = <(x,y) || x==ymight not hold. Take for instance
using IntervalArithmetic: IntervalArithmetic, interval
using Unitful: Unitful, m
a = interval(0, 0)
b = interval(0, 1)
@assert a <= b
@assert a*m <= b*m # assertion failure hereand the reason why is:
julia> a <= b
true
julia> a < b
false
julia> a == b
falseIt seems worthwhile to delegate all comparison methods, not only isless and <, at
https://github.com/PainterQubits/Unitful.jl/blob/47d131be92eefae1b49cd02b0a9f9a55b74be97f/src/quantities.jl#L263-L275
Metadata
Metadata
Assignees
Labels
No labels