On Mon, Aug 21, 2017 at 12:56:19PM +0000, Jan Mercl wrote:

>> That is
>>
>> const onethird = 1 / 3
>>
>> has greater precision than
>>
>> onethird := float64(1) / 3
> 
> Zero does not seem to have greater precision than 0.3333333333333333 when
> approximating the real number 1/3.

IMHO, the less smart-ass responses the list would see, the better.

But I see your point, thanks.

To the OP: the first statement should have been

  const onethird = 1.0 / 3

instead.

By the way, currently defined limits the compliant Go compilers must
support with regard to constants, can be found in [1].

1. https://golang.org/ref/spec#Constants

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to