You can set your precision arbitrarily high, but you will still find a point at which there are non-zero decimal digits.
https://play.golang.org/p/JYcAvXQPfeO 123.4 cannot be represented in binary with a finite number of bits. On Sun, 2021-02-14 at 13:33 -0800, Santhosh Kumar T wrote: > now I understand it. why they are not same > > but why f2 printed as 123.40000000000000000139 > f2 is constructed using SetString method, so it should be accurate > and printed as 123.40000000000000000000. -- 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/7e80e8d2a324824f0c987ecc8fe0441cc70877d7.camel%40kortschak.io.