I have a very peculiar situation where I am trying to perform a logical test, where the difference of the absolute value is producing the wrong output. It seems as if this is sensitive after the 2nd decimal but its still arbitrary as I have and example with two decimals where the answer is proper. The problem seems to get solved with inputting the 'round' function (in case anyone else has struggled with this and wants a quick solution), but it is still peculiar to me how this can happen.
Asked
Active
Viewed 12 times
0
-
This sort of behavior is a common and frustrating consequence of floating point numbers in general. Does this answer your question? https://stackoverflow.com/questions/9508518/why-are-these-numbers-not-equal – Jon Spring Apr 23 '21 at 08:06
-
I suspected so. Thank you sir! – Michael Grammatikopoulos Apr 23 '21 at 08:14