Closed
Description
julia> 2 * 0.5Q1f14
ERROR: InexactError()
Stacktrace:
[1] convert at /home/fengyang/.julia/v0.6/FixedPointNumbers/src/fixed.jl:42 [inlined]
[2] promote at ./promotion.jl:174 [inlined]
[3] *(::Int64, ::FixedPointNumbers.Fixed{Int16,14}) at ./promotion.jl:247
This is happening because 2
is not representable in Q1f14, even though the result 1
would be. I think it is avoidable by specializing ::Integer * ::FixedPoint
(and ::FixedPoint * ::Integer
?) directly, but I don't have much experience with this. If this is the right thing to do, I'll make a PR.
Metadata
Metadata
Assignees
Labels
No labels