Mod-function in the relations
Mod-function in the relations
(OP)
In Pro E Wildfire 3.0 is it possible to click - inside the relations - on an icon with fx on.
Then you got a submenu with all the function who are possible in wildfire. If you look closely, you can find a 'mod' function. I thought it was the remainder of a division of one number by another.
I need that function in my automation-program.
What I wanted to do was the following thing:
If (mod(LENGTH/X, 2) == 0
Y = ..
ELSE
Y =...
ENDIF
So in fact, I need to check if the number is odd or even.
Now the problem is, I know the 'mod'-function exist, because i can find it in the list, but i don't know how to implement it.
I guessed it was MOD(NUMBER1,NUMBER2) but cleary this doesn't work, because always, even if the number is even or odd, it skips the if-statement, just like i wrote something that can't be true
Someone who knows this? Because I check your FAQ and those functions are clearly not allowed
Then you got a submenu with all the function who are possible in wildfire. If you look closely, you can find a 'mod' function. I thought it was the remainder of a division of one number by another.
I need that function in my automation-program.
What I wanted to do was the following thing:
If (mod(LENGTH/X, 2) == 0
Y = ..
ELSE
Y =...
ENDIF
So in fact, I need to check if the number is odd or even.
Now the problem is, I know the 'mod'-function exist, because i can find it in the list, but i don't know how to implement it.
I guessed it was MOD(NUMBER1,NUMBER2) but cleary this doesn't work, because always, even if the number is even or odd, it skips the if-statement, just like i wrote something that can't be true
Someone who knows this? Because I check your FAQ and those functions are clearly not allowed





RE: Mod-function in the relations
mod(5,2)=1
mod(5,3)=2
mod(5,4)=1
mod(2,2)=0
mod(7,4)=3
So I would say MOD returns the remainder after a division just like you expected. I think you are missing a closing ")" in your equation.
RE: Mod-function in the relations
I've implemented a function:
Z = X/Y with X = n*Y and Y = reel number (ex: 150.8) with n an integer!
and then used Z in MOD(Z,2)
And he always returned 2 as remainder. The problem was that I didn't 'round' (floor i supposed, I never checked ceil) Z,
If i implement Z = floor(X/Y), the mod-function did work after all. Apparently the following works without floor:
Z = X/Y with X = n*Y en Y = 7.0
although i implemented X en Y as a reelnumber and not an integer.