Skip to content

.NET Core 3.1 compiles integral conversions to doubles differently than real literals. This is not true for .NET Framework. #4074

Discussion options

You must be logged in to vote

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

Replies: 2 comments 25 replies

Comment options

You must be logged in to vote
5 replies
@zacknewman
Comment options

@YairHalberstadt
Comment options

@zacknewman
Comment options

@tannergooding
Comment options

@zacknewman
Comment options

Comment options

You must be logged in to vote
20 replies
@tannergooding
Comment options

@zacknewman
Comment options

@tannergooding
Comment options

@zacknewman
Comment options

@tannergooding
Comment options

Answer selected by zacknewman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants