Math 

Syntax: #math {variable} {mathematical expression} 

See the mathematics manual entry for a list of operators that can be used. 

Math allows you to perform calculations and store the result in the given variable. It also allows for string and regexp comparisons. 

Example: #math sumvar {(1 + 1) * 10} 

This basic operation would store the result (which is 20) in sumvar. 

If the calculation contains floating point numbers the result is stored as a floating point number with the same precision as the argument with the highest precision. 

Example: #math var {1.0 / 4} 

Stores the result (which is 0.2) in var. Using 1.00 / 4 would store 0.25 

Example: #math var 2d6 

The d operator stands for dice, with 2d6 being the equivalent of throwing two 6headed dice. If you need a random number between 1 and 100 you would use 1d100. If you need a random number between 0 and 9 you would use 1d10  1. 

Example: The other operators behave more or less like one would expect. 

See also: Format, Function, Local, Replace, Script and Variable. 
