On Wednesday, July 8, 2020 at 4:50:30 PM UTC-7, simon place wrote:
>
> wait a minute, so this...  https://play.golang.org/p/x5SQVgSJsIs
>
> could return anything!
>
>
I think float -0 should be guaranteed to convert to integer 0.
Just like -0.25 and 0.25. The spec says "fraction discarded" but I 
interpret that as throwing away the - in front of the zero (being an 
infinitesimal negative fraction).

Only if *after* rounding towards zero, if the value doesn't fit then the 
result is implementation dependent.
 

> On Wednesday, 8 July 2020 19:57:30 UTC+1, Ian Lance Taylor wrote:
>>
>> The spec is not particularly helpful, but it is not entirely silent. 
>> It 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." 
>>
>> Ian 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e3d22561-b2ea-43a6-98f6-6840d0e878e3o%40googlegroups.com.

Reply via email to