Hello,
I wrote a very simple expression and used the Round function. The output of the Round function (i.e. 3.14) is correct, but when I multiply that output by a constant of 10, it is giving me the answer of 31.400000000000002 instead of 31.4. Is there a simple explanation for this? Did I miss something? Thanks!
Solved! Go to Solution.
It is called "floating point representation" an historic issue well covered.
you might want to round the multiplied value as well.
Python example, which you can emulate in arcade with concatenation
"{} vs {}".format(round(math.pi, 2), round(math.pi * 10, 1))
'3.14 vs 31.4'
,
It is called "floating point representation" an historic issue well covered.
you might want to round the multiplied value as well.
Python example, which you can emulate in arcade with concatenation
"{} vs {}".format(round(math.pi, 2), round(math.pi * 10, 1))
'3.14 vs 31.4'
,
Thank you for the quick reply, Dan!