Forum Discussion
ValentinasS
Dec 29, 2021Copper Contributor
Calculation problem
Hi, I`m trying to calculate 39,46-40 and expecting to get -0,54, but getting instead -0,539999999999999 what is the cause of that? BR, Val
Riny_van_Eekelen
Dec 29, 2021Platinum Contributor
ValentinasS I suspect that the number you start of with is actually something like 39.46000001, formatted to display only two decimals. Use ROUND if you want Excel to calculate with two decimal accuracy.
ValentinasS
Dec 29, 2021Copper Contributor
no, numbers are exactly 39,46 and 40, please try to do that by yourself, I tried it on multiple computers, and the result is the same
- Riny_van_EekelenDec 29, 2021Platinum Contributor
ValentinasS Well, not on any of my computers (Mac and PC).
- ValentinasSDec 29, 2021Copper Contributor
Riny_van_Eekelen
for better problem understanding I filmed what is the problem, do get the same results as me or did you get 0 in the final?https://youtu.be/u4w1pNmhrxs
BR,
Val
- Riny_van_EekelenDec 29, 2021Platinum Contributor
ValentinasS Okay! That's indeed a floating point error as explained in the video that Detlef_Lewin uploaded. Otherwise, you'll find much written on the subject, on-line.
- Detlef_LewinDec 29, 2021Silver Contributor