Can somebody explain this odd behaviour when wrapping a number?
Hi peeps,
I came across a post on reddit from a user having an issue processing a float number through an if statement. it seems that wrapping a number doesn't correctly work but I figured out that using the [round] object fixes that.
Do you think it's a truncation issue or something else, another one of Max's idiosyncrasies?
Hi Fora 😄
short answer:
go into the inspector of the floating-point number box, and increase the number of decimal places as shown here, and you'll see the numbers you enter into it are never the exact numbers you expect:

here's your same patch but extending the number-box and the number of decimal places to be able to view more of the actual number:
using rounding to explicitly cater algorithms to a specific decimal place, is a great solution 👍
tis not just an idiosyncracy of Max, but of floating point arithmetic calculated by human-made computing means, in general 👽
long answer:
https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
hope it helps 🍻
Thank you Raja (the legend!), of course!