We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
julia> d64"0.1" == 1//10 false
This should be true. Fixing this (and issue #79) is important to get hash() working (issue #97).
true
hash()
The text was updated successfully, but these errors were encountered:
This is calling ==(x::AbstractFloat, q::Rational), which assumes binary floating-point.
==(x::AbstractFloat, q::Rational)
A correct implementation is probably something like:
function ==(x:: DecimalFloatingPoint, q::Rational) if isfinite(x) ispow10(q.den) & (x*q.den == q.num) else x == q.num/q.den end end
Sorry, something went wrong.
Also need to implement Base.decompose()
Base.decompose()
julia> d64"0.3" < 1//3 ERROR: MethodError: no method matching decompose(::Dec64) Closest candidates are: decompose(::BigFloat) at hashing2.jl:133 decompose(::Float64) at hashing2.jl:122 decompose(::Float32) at hashing2.jl:111 ... Stacktrace: [1] <(::Dec64, ::Rational{Int64}) at ./rational.jl:316 [2] top-level scope at REPL[3]:1
Successfully merging a pull request may close this issue.
This should be
true
. Fixing this (and issue #79) is important to gethash()
working (issue #97).The text was updated successfully, but these errors were encountered: