This object is in archive! 

Forced rounding create precision troubles

gvitalie shared this problem 3 years ago

Good morning, Dear GeoGebra and GeoGebrians.

Forced rounding create precision troubles when need to exact draw values with periodic digits for: segments, squares, areas, etc.

According to Pythagoras Theorem, we should sum areas of two squares something like that.

It should be 0.999..., if 2/9 + 7/9 = 0.222... + 0.777... = 0.999...

See attached picture for details, there we could see that area is equal one instead of 0.999....

Thank You.


Comments (2)


calculate with 32/64 bit in decimal is alway an approximation.

Usual is with rounding and in the most applications this is more exact (see attachment).

If you want cut instead of round for your division you can use

floor(n / 9 (10¹⁵)) / 10¹⁵



Good morning, Dear @rami.

I've understood what's the explanation: it's difference of numerical representation with finite precision and infinite precision.


- with FINITE precision we'll always have: 1/9 + 8/9 = 0.999... until maximum precision resolution

and when we do rounding, we compensate that finite precision resolution.

- with INFINITE precision we'll always have 1/9 + 8/9 = 1


Comments have been locked on this page!

© 2021 International GeoGebra Institute