[Logo]
Forums Register Login
Rounding technique
Hi,

1. What is the rounding technique used for Math.round()? I believe it is using HALF-UP rounding (The one we used to learn in elementary school).

2. I know float data type holds 7 significant digits and double holds 16 significant digits. However, when I tested it, the output looks weird.



output:
3.141592653589793 (why double type only outputs 15-significant digits? not 16 significant digits?)
3.1415923 (why is the 7th significant digit 3? What rounding technique does it use?)
3.141593 (why only shows 6-significant digits? not 7?)
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards


This thread has been viewed 76 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 21, 2018 02:38:30.