Can somebody explain this odd behaviour when wrapping a number?

Fora's icon

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?

Max Patch
Copy patch and select New From Clipboard in Max.

👽'tW∆s ∆lienz👽's icon

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:

Max Patch
Copy patch and select New From Clipboard in Max.


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 👽

Fora's icon

Thank you Raja (the legend!), of course!