Yes, you can use the
() mod ()
block in Operators.
It returns the remainder when dividin the first number by the second, so a multiple of a number will return remainder 0.
<[(x) mod (3)] = [0]>
will return true if x is a multiple of 3
will return false if x is not a multiple of three.
Offline
kayybee wrote:
Yes, you can use the
() mod ()
block in Operators.
It returns the remainder when dividin the first number by the second, so a multiple of a number will return remainder 0.
<[(x) mod (3)] = [0]>
will return true if x is a multiple of 3
will return false if x is not a multiple of three.
Thanks so much!
Offline
Sonickyle wrote:
Does this work with Decimals? I can't get it working...
forever if <((timer) mod (0.5)) = (0)> ...Basicly, it doesn't fire when the timer gets at 0.5, 1.0, 1.5, etc.
Well, it should. I'm not entirely sure what's going on, though I do have an idea developing. In the meanwhile, you could try doing this:
forever if <(((round ((10) * (timer))) / (10)) mod (0.5)) = (0)>//Multiple the 10's by 10 for greater accuracy. ...
Offline
ErnieParke wrote:
Sonickyle wrote:
Does this work with Decimals? I can't get it working...
forever if <((timer) mod (0.5)) = (0)> ...Basicly, it doesn't fire when the timer gets at 0.5, 1.0, 1.5, etc.Well, it should. I'm not entirely sure what's going on, though I do have an idea developing. In the meanwhile, you could try doing this:
forever if <(((round ((10) * (timer))) / (10)) mod (0.5)) = (0)>//Multiple the 10's by 10 for greater accuracy. ...
I hope that this helps!
I'll give it a shot. Thanks for the help!
Offline