We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 88cd163 commit 49934cdCopy full SHA for 49934cd
2 files changed
src/ufixed.jl
@@ -79,7 +79,7 @@ abs(x::UFixed) = x
79
80
# Comparisons
81
<{T<:UFixed}(x::T, y::T) = reinterpret(x) < reinterpret(y)
82
-<={T<:UFixed}(x::T, y::T) = reinterpret(x) < reinterpret(y)
+<={T<:UFixed}(x::T, y::T) = reinterpret(x) <= reinterpret(y)
83
84
# Functions
85
trunc{T<:UFixed}(x::T) = T(div(reinterpret(x), rawone(T))*rawone(T),0)
test/ufixed.jl
@@ -157,6 +157,9 @@ for T in (FixedPointNumbers.UF..., UF2...)
157
testtrunc(eps(T))
158
end
159
160
+@test !(UFixed8(0.5) < UFixed8(0.5))
161
+@test UFixed8(0.5) <= UFixed8(0.5)
162
+
163
@test div(0x10uf8, 0x02uf8) == fld(0x10uf8, 0x02uf8) == 8
164
@test div(0x0fuf8, 0x02uf8) == fld(0x0fuf8, 0x02uf8) == 7
165
@test Base.fld1(0x10uf8, 0x02uf8) == 8
0 commit comments