Why is one result -0 and the other 0 when the mechanics between formulas and parameters are the same ?
Best answer by Alexey_Gusev
In short, it's a common issue with floating point numbers. Computers can't store most decimal values exactly, so tiny errors happen in calculations. Even if the math looks simple, like 1.23 - 0.9 - 0.33, the result might not be exactly zero - just very close. That's why you sometimes see weird small differences like -0.0000000001 instead of 0. Always expect a little wiggle room when working with decimals in code or spreadsheets.
Well, I knew that, but that’s surprise for me - when difference is <10⁻¹⁶ it counts as equal I tried change to Currency type - not helped. Rounding solved the issue
In short, it's a common issue with floating point numbers. Computers can't store most decimal values exactly, so tiny errors happen in calculations. Even if the math looks simple, like 1.23 - 0.9 - 0.33, the result might not be exactly zero - just very close. That's why you sometimes see weird small differences like -0.0000000001 instead of 0. Always expect a little wiggle room when working with decimals in code or spreadsheets.
Well, I knew that, but that’s surprise for me - when difference is <10⁻¹⁶ it counts as equal I tried change to Currency type - not helped. Rounding solved the issue
The weird behaviour is when the user inputs the exact numbers without previous calculations. Then you’d expect more accuracy but the machine might see it otherwise.