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 implementation-dependent behavior, and not a bug.
The 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.
Unfortunately +Inf is not representable as an int.
go playground
What did you expect to see?
I expected to see positive infinity representation or 9223372036854775807
What did you see instead?
-9223372036854775807
The text was updated successfully, but these errors were encountered: