Skip to content

Commit 3acd59a

Browse files
committed
add comparison between Furlong and Number
1 parent ca7da54 commit 3acd59a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/testhelpers/Furlongs.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ end
7676
for op in (:(==), :(!=), :<, :<=, :isless, :isequal)
7777
@eval $op(x::Furlong{p}, y::Furlong{p}) where {p} = $op(x.val, y.val)::Bool
7878
end
79+
for op in (:(==), :isequal)
80+
@eval $op(x::Furlong{p}, y::Furlong{q}) where {p,q} = false
81+
@eval $op(x::Furlong, y::Number) = $op(promote(x, y)...)
82+
@eval $op(x::Number, y::Furlong) = $op(y, x)
83+
end
7984
for (f,op) in ((:_plus,:+),(:_minus,:-),(:_times,:*),(:_div,://))
8085
@eval function $f(v::T, ::Furlong{p}, ::Union{Furlong{q},Val{q}}) where {T,p,q}
8186
s = $op(p, q)

0 commit comments

Comments
 (0)