-
Notifications
You must be signed in to change notification settings - Fork 33
Inconsistent Integer
results
#154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Milestone
Comments
BTW, there is no longer a zero-argument > julia> Integer(1.5Q1f6)
ERROR: MethodError: no method matching InexactError()
Closest candidates are:
InexactError(::Symbol, ::Any, ::Any) at boot.jl:280 FixedPointNumbers.jl/src/fixed.jl Lines 67 to 74 in 7ad0f0c
Also, I don't think this specialization makes much sense. (There is no ambiguity.) |
There is the problem of type inconsistency in julia> typeof(Rational(0.5Q1f6))
Rational{Int64}
julia> typeof(Rational(0.5Q0f7))
Rational{Int64}
julia> typeof(Rational(0.5Q1f62))
Rational{Int128}
julia> typeof(Rational(0.5Q0f63))
Rational{Int128} julia> typeof(Rational(0.5N0f8))
Rational{UInt8}
julia> typeof(Rational(0.5N0f64))
Rational{UInt64} I also think it is better to use the rawtype |
This was referenced Jan 12, 2020
Merged
kimikage
added a commit
that referenced
this issue
Jan 16, 2020
Commonize further code between `Fixed` and` Normed` (Fixes #154)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The return types of
Integer(::Fixed)
andInteger(::Normed)
are based on different manners.Fixed{T}
:T
Normed
:Int
with (non-intuitive) promotionsFloat
:Int
w/o promotionsI think it is better to unify the manners, even though it will be a breaking change.
I consider it appropriate for
FixedPoint
to return numbers in the rawtypeT
asInteger(::Fixed)
returns.FYI, with fix for issue #153, we can use
floor(Integer, x)
etc.The text was updated successfully, but these errors were encountered: