As of version 1.3.5.60, the Real Math Mode or RMM engine permits the use of standard mathematical expressions. These replace the add, subtract, multiply, divide and modulo functions.
From version 1.4.3, the RMM engine has been replaced by LAMP (or LAMP Logic And Mathematics Parser). This works in a totally different way to RMM but it gives the same results. It works on logic as well as standard mathematics.
Expressions can be written as standard maths, like that found in other languages such as JavaScript, C or Visual Basic:
$a = 84 + 43 * 2 $b = 91 - 22 % $a
The LAMP parser was replaced with the LAME evaluator which performs twice as well as the LAMP parser.
Operator | Purpose | Example |
---|---|---|
+
|
Addition |
5 + $v
|
-
|
Subtraction |
10 - $v
|
*
|
Multiplication |
3 * $v
|
/
|
Division |
50 / $v
|
%
|
Modulo |
10 % $v
|
In a similar way, logical expressions are evaluated by the LAME parser.
$a = true && false $b = true || false
The following is a list of logical operators:
Operator | Purpose | Example |
---|---|---|
&&
|
Logical AND |
|
AND
|
Logical AND |
|
||
|
Logical OR |
|
OR
|
Logical OR |
|