Skip to content
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

incorrect hashing of large floats #8619

Closed
simonbyrne opened this issue Oct 8, 2014 · 1 comment
Closed

incorrect hashing of large floats #8619

simonbyrne opened this issue Oct 8, 2014 · 1 comment
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@simonbyrne
Copy link
Contributor

For Float64s on the interval (2^63, 2^64), the hashes don't match those of the corresponding Uints (or BigFloats):

julia> x = 0x1.8p63
1.3835058055282164e19

julia> u = convert(Uint,x)
0xc000000000000000

julia> hash(x)
0x9815276104e1427d

julia> hash(u)
0xf9d22a93486bf9f9

julia> hash(big(x))
0xf9d22a93486bf9f9

The problem is that on this line, fptosi always returns -typemin(Int64) for all values >= 2^63 (this is the same problem as in #7517).

@simonbyrne simonbyrne changed the title float hashing bug incorrect hashing of large floats Oct 8, 2014
@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label Oct 8, 2014
@StefanKarpinski
Copy link
Sponsor Member

Oh, man, this stuff is so tricky to change. I'll have to think on it for a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants