-
Notifications
You must be signed in to change notification settings - Fork 5k
Inconsistent Double to UInt64 conversion on ARM vs x64 Architectures #94922
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
Comments
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsDescriptionWhen converting the double value Reproduction StepsIn Expected behaviorThe conversion of Actual behavior
|
This is a known difference as the exact semantics for floating-point values which cannot be represented in the destination format is considered undefined behavior (by IEEE 754, by the runtime, and by most languages). Many platforms have standardized on Adjusting .NET to have deterministic behavior here is tracked by #61885 and is being actively worked on. We plan on matching the saturating behavior that many platforms expect and converting |
Uh oh!
There was an error while loading. Please reload this page.
Description
When converting the double value
1.8446744073709552E+19
to auint64
, the result of the conversion changes based on the architectureReproduction Steps
In
dotnet fsi
runuint64(1.8446744073709552E+19);;
Expected behavior
The conversion of
1.8446744073709552E+19
touint64
should be consistent across different architecturesActual behavior
uint64(1.8446744073709552E+19) = 18446744073709551615
.uint64(1.8446744073709552E+19) = 0
The text was updated successfully, but these errors were encountered: