CALC 1 Home Documentation Home Contact
Loading

CALC 1 Logical Functions

 

Function Desc Example Example Result
and(x,y) Returns 1 (TRUE) if all arguments are not equal to 0, and 0 (FALSE) otherwise. and(true,false) 0
delta(x,y) Returns 1 if two numbers are equal, and 0 otherwise. delta(4, 5) 0
gestep(compare, step) Returns 1 if compare is greater than or equal to step. gestep(4, 5) 0
if(bool, ifTrue, ifFalse) The value of the second argument if the first argument evaluates as Boolean TRUE (not equal to 0). Otherwise it returns the value of the third argument. This currently does not support '<' or '>'. Use DELTA and GESTEP functions instead. Note that both ifTrue and ifFalse will be evaluated. if(1, me, mpi) 2.72
iseven(x) Returns TRUE if the value is an even number. iseven(2.75) 1
isodd(x) Returns TRUE if the value is an odd number. isodd(2.75) 0
not(x) The opposite of the Boolean (1, 0) value of a specified expression. not(true) 0
or(x,y) Returns 1 (TRUE) if any of the arguments are equal to 1, and 0 (FALSE) otherwise. or(0,0) 0