Sean,

Your comment is not correct.  You can take the original program I wrote and
increase the digits and will notice they are printed as they are meant to
be.

Also, if you were to take an int(f), you will note that it returns "0", and
not "1".

Sorry!  Incorrect information ought to be corrected.  Run some tests to
convince yourself.

D

On Mon, Oct 10, 2022 at 5:34 PM Sean Liao <s...@liao.dev> wrote:

> > leaving one with the impression those digits will be as they are in the
> float, and not rounded.
>
> This is a fundamental misunderstanding of what a float is. The rounding
> happens the moment a value is stored in a float. The printed value is
> exactly what is stored.
>
> - sean
>

-- 
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/CAEaSmXdenhQHEL-Pkd0mLg%2B0SKR6zdBYxvnV6P3kNQvVyOjn1A%40mail.gmail.com.

Reply via email to