Forum Discussion
Why 4 equals 5?
I thought a dividing operation is required to get an floating point error. This is a minus operation??
Well, you thought incorrectly.
The kind of arithmetic operation does not matter.
- Rolf HansmannFeb 11, 2017Copper Contributor
and what to do about it if it occurs at the 2 place after the decimal point and other programs like Spss or SAS are calculating it right. i might be wrong but for me it seems other programmers where able to avoid it by better implementing the algorithms or using a better library.
I calculated this with many programs and you find right and wrong.
- Detlef_LewinFeb 11, 2017Silver Contributor
In Excel your are more or less limited to this:
How to correct rounding errors in floating-point arithmetic
- Rolf HansmannFeb 20, 2017Copper Contributor
Hi, I am not rounding, I use the integer operation. It just cuts everything after the decimal point. I strongly believe the minus operation calculates wrong at the second place after the decimal point. Financial institutions shoul better know it an not using Excel to calculate. Again, use Spss to calculate the same formula. It calculates correct.