Normed supports the conversion to Rational, but does not support the conversion from Rational.
julia> N0f8(1//2)
ERROR: MethodError: no method matching unsafe_trunc(::Type{UInt8}, ::Rational{Int64})
Fixed supports the conversion from Rational, but it overflows too easily.
julia> Q0f7(1//2)
ERROR: InexactError: trunc(Int8, 128)
|
Fixed{T,f}(x::Rational) where {T,f} = Fixed{T,f}(x.num)/Fixed{T,f}(x.den) |
Normedsupports the conversion toRational, but does not support the conversion fromRational.Fixedsupports the conversion fromRational, but it overflows too easily.FixedPointNumbers.jl/src/fixed.jl
Line 15 in 7ad0f0c