Re: 1.5 on a counter object
Quote:
Originally Posted by Robin_Manager
I am doing this
Val(Edittext$( "Force" ))/Val(Edittext$( "Acceleration" ))*1.0
And it comes out as 0 when the force value is 10 and the acc = 100
you need to put the *1.0 in parentheses with one of the Val() expressions (actually, you really only need to use the parenthesis with the second Val() but i find expressions easier to read when i don't even have to think about 'implied' order of operations)
right now, MMF is doing the division before the multiplication (i think it always does division before multiplication), so while you still get a float in the end, you really need that float BEFORE you divide
Re: 1.5 on a counter object
Thanks for that help,
Here is another problem ( I am really sorry about asking so many questions)
Val(Edittext$( "Force" ))*1.0/Val(Edittext$( "Mass" ))
Force = 0.25
Mass = 0.25
Answer = 1
Actual answer 0.625
Whats going on?
Re: 1.5 on a counter object
0.25 / 0.25 is 1, not 0.625...
Re: 1.5 on a counter object
Oh dear god, it was right :D
Re: 1.5 on a counter object
0.25 / 0.25 is 1
0.25 * 0.25 is 0.0625