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 reinterpret() UInt32 -> Float64 -> UInt64 behaviour on win32 #18019

Closed
alyst opened this issue Aug 13, 2016 · 2 comments
Closed

Incorrect reinterpret() UInt32 -> Float64 -> UInt64 behaviour on win32 #18019

alyst opened this issue Aug 13, 2016 · 2 comments

Comments

@alyst
Copy link
Contributor

alyst commented Aug 13, 2016

The following command (for the context see JuliaData/RData.jl#2)

reinterpret(UInt64, reinterpret(Float64, UInt32[0x1, 0x7ff00000])[1])

on julia-0.5-rc2 on linux 64bit gives

0x7ff0000000000001

but on julia-0.5-rc2 on win 32bit

0x7ff8000000000001

The latter doesn't seem right, because the final UInt64 differs from the input array.

Interestingly, if the first UInt32 is zero, both versions return the correct result.

@yuyichao
Copy link
Contributor

This is a hardware/abi limit, it doesn't preserve the exact bit patter of NaN.

@yuyichao
Copy link
Contributor

Dup of #17195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants