.NET Core 3.1 compiles integral conversions to doubles differently than real literals. This is not true for .NET Framework. #4074
-
Description
Configuration
Other information
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 25 replies
-
It seems this is actually a difference between x64 and x86, even on .Net Framework. The compiler converts this comparison straight to a constant, but the constant is false for x86, and true for x64. @tannergooding any ideas here? |
Beta Was this translation helpful? Give feedback.
-
This is a determinism bug and looks to be caused by Roslyn depending on the runtime for the ulong -> double conversion. x64 vs x86 doesn't matter. The root cause is a runtime bug in the conversion code: dotnet/runtime#43895 Roslyn could implement its own conversion algorithm for correctness such as by using the Berkeley SoftFloat 3 implementation which is known to be good/correct: https://github.com/ucb-bar/berkeley-softfloat-3/blob/master/source/ui64_to_f64.c |
Beta Was this translation helpful? Give feedback.
This is a determinism bug and looks to be caused by Roslyn depending on the runtime for the ulong -> double conversion. x64 vs x86 doesn't matter.
The root cause is a runtime bug in the conversion code: dotnet/runtime#43895
Roslyn could implement its own conversion algorithm for correctness such as by using the Berkeley SoftFloat 3 implementation which is known to be good/correct: https://github.com/ucb-bar/berkeley-softfloat-3/blob/master/source/ui64_to_f64.c