cmd/compile: incorrect double rounding for conversion from uint64 to float32 on 32-bit platforms #48807
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Test program:
On amd64 this prints
On 386 it prints
The second number is different. This is happening because on 386 we convert a
uint64
tofloat32
by first converting tofloat64
(viaruntime.uint64tofloat64
) and then converting that tofloat32
. This introduces a double-rounding. Specifically theuint64
value0x1.0468a1p+63
converts tofloat32
0x1.0468ap+63
, but the correct result of the original rounding is0x1.0468a2p+63
.The text was updated successfully, but these errors were encountered: