MathNot | built-in logical "not" |
MathAnd | built-in logical "and" |
MathOr | built-in logical "or" |
BitAnd, BitOr, BitXor | bitwise arithmetic |
Equals | built-in equality check |
GreaterThan, LessThan | arithmetic predicates |
Math... | arbitrary-precision math functions |
Fast... | double-precision math functions |
ShiftLeft, ShiftRight | built-in bit shifts |
SetCommand(LispSubtract, "MathSubtract"); |
Built-in bodied functions and infix operators are declared in the same file.
MathNot(expression) : Returns "False" if "expression" evaluates to "True", and vice versa.
MathAnd(...) |
Lazy logical And: returns True if all args evaluate to True, and does this by looking at first, and then at the second argument, until one is False. If one is False it immediately returns False without evaluating the rest. This is faster, but also means that none of the arguments should cause side effects when they are evaluated.
MathOr(...) |
MathOr is the basic logical "or" function. Similarly to And, it is lazy-evaluated. And(...) and Or(...) do also exist. You can define them as infix operators yourself, so you have the choice of precedence. In the standard scripts they are in fact declared as infix operators, so you can write expr1 And expr.
BitAnd(n,m), BitOr(n,m), BitXor(n,m) : return bitwise and, or and xor of two numbers.
Equals(a,b) : Compares evaluated a and b recursively (stepping into expressions). so "Equals(a,b)" returns "True" if the expressions would be printed exactly the same, and "False" otherwise.
LessThan(a,b), GreaterThan(a,b) : Comparing numbers.
Calculation of sin,cos,tan etc. of x. x HAS to be a number. The reason Math is prepended to the names is you might want to derive equivalent non-evaluating functions. The Math... versions require the arguments to be numbers.
Versions of these functions using the internal c version. These should then at least be faster than the arbitrary precision versions.
ShiftLeft(expr,bits) ShiftRight(expr,bits) |