You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is documented and expected. In the section https://go.dev/ref/spec#Conversions, under "Conversions between numeric types", the language spec says:
In all non-constant conversions involving floating-point or complex values, if the result type cannot represent the value the conversion succeeds but the result value is implementation-dependent.
The type int can't represent a NaN value, so the result is implementation dependent.
You may have better luck with math.Float64bits, but even that is not guaranteed to produce the same results on every implementation, as different implementations use different representations for NaN values produced by expressions.
Go version
go version go1.22.3 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
What did you expect to see?
i think expect same results even different GOARCHs
The text was updated successfully, but these errors were encountered: