Strange floor() problem-Please Help!
Posted: 12 Feb 2015 14:01
Hi There!
Hoping someone can help with a strange problem I'm seeing. Hopefully something simple!
I'm using the floor function to thin a multislider value. It can be reproduced easily -
If I have a multislider that I would like to output values between 0-100 I use the following line in a script that is triggered by a change to the slider value (x):
test=floor(x*100);
Setting up 2 monitors - 1 for the slider value multiplied by 100 and another to monitor the test variable. The slider value will get to 100 but the test variable will never go higher than 99
Does anybody know why this is? It seems to be rounding 100.000 down to 99 which does doesnt make sense or am I missing something?
Thanks
R
Hoping someone can help with a strange problem I'm seeing. Hopefully something simple!
I'm using the floor function to thin a multislider value. It can be reproduced easily -
If I have a multislider that I would like to output values between 0-100 I use the following line in a script that is triggered by a change to the slider value (x):
test=floor(x*100);
Setting up 2 monitors - 1 for the slider value multiplied by 100 and another to monitor the test variable. The slider value will get to 100 but the test variable will never go higher than 99
Does anybody know why this is? It seems to be rounding 100.000 down to 99 which does doesnt make sense or am I missing something?
Thanks
R