strange multiplication issue
Hi folks having a very strange multiplication issue, never came across it.
just multiplying two integers . with small numbers, multiplications work as expected , higher numbers give totally strange results. Using a [*] or [expr] object gives the same strange results, whereas doing the same operation with [js] all is fine.
calculating outside of max returns the correct expected numbers ( just to check my machine isn't crazy ).
see the screenshot. ( i restarted max, the computer, reset the ram, same problem keeps occuring )
Max 6.1.7
Mac osx 10.6.8
Your example shows that integers are 32 bit in max. The result of your calculation is just above the maximum value of 2^32 (=4294967296) and therefor the result wraps around.
505032705 + 4294967296 = 4800000000
Using a floating point multiplication (instead of an integer multiplication) solves your problem. And don't forget to use a float numberbox to display the result. You have already done this for the js implementation.
Thanks for the clarification Edwin, i had a dim feeling it was related to the 32bit limitation ...
stupid question of mine , apologies for the noise :)