We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 045b3f0 + 8462f61 commit fe244ddCopy full SHA for fe244dd
1 file changed
src/ufixed.jl
@@ -48,8 +48,8 @@ _convert{U<:UFixed,T}(::Type{U}, ::Type{T}, x) = U(round(T, widen1(rawone(
48
_convert{U<:UFixed }(::Type{U}, ::Type{UInt128}, x) = U(round(UInt128, rawone(U)*x), 0)
49
50
rem{T<:UFixed}(x::T, ::Type{T}) = x
51
-rem{T<:UFixed}(x::UFixed, ::Type{T}) = reinterpret(T, rem(unsafe_trunc(UInt, round((rawone(T)/rawone(x))*reinterpret(x))), rawtype(T)))
52
-rem{T<:UFixed}(x::Real, ::Type{T}) = reinterpret(T, rem(unsafe_trunc(Int, round(rawone(T)*x)), rawtype(T)))
+rem{T<:UFixed}(x::UFixed, ::Type{T}) = reinterpret(T, unsafe_trunc(rawtype(T), round((rawone(T)/rawone(x))*reinterpret(x))))
+rem{T<:UFixed}(x::Real, ::Type{T}) = reinterpret(T, unsafe_trunc(rawtype(T), round(rawone(T)*x)))
53
54
convert(::Type{BigFloat}, x::UFixed) = reinterpret(x)*(1/BigFloat(rawone(x)))
55
function convert{T<:AbstractFloat}(::Type{T}, x::UFixed)
0 commit comments