# Functions and operators to use in simulations

You can use the following functions and operators in the equation editor in the Monte Carlo simulation tool.
Symbol Name Description Syntax Example
square root Calculates the square root for a positive number. A negative number returns *. sqrt(number) sqrt(100) returns 10
X2 X squared Multiplies the number by itself. number^2 4^2 returns 16
X3 X cubed Multiples the number by itself three times. number^3 4^3 returns 64
Xn X to the nth Multiplies the number by itself the number of times you specify. number^n 4^6 returns 4,096
π pi Multiplies the number by 3.14. pi(number) pi(4) returns 12.5663706144
log logten Calculates logarithm to the base 10 logten(number, base) log(7.38905) returns 2
ln natural log(log base e) Calculates logarithm to the base e. ln(number) ln(7.38905) returns 2
ex exponential Calculates e raised to a power, where e is the constant 2.718281. exp(number) exp(2) returns 7.39
if   Checks whether a condition is met, and returns one value if true, and another value if false. if(logical_test, value_if_true, value_if_false) if(variable1>5, 1, 0) returns 1 if variable1 is greater than 5, and returns 0 if variable1 is less than or equal to 5
and   Checks whether all of the conditions are true. Returns true if all conditions are met and false otherwise. It is often useful to use the "and" function as the first argument of an "if" function, for example, if(and(logical_test1, logical_test2, ...), 1, 0). and(logical_test1, logical_test2, ...) and(variableA>5, variableB >7) returns 1 if variableA is greater than 5 and variableB is greater than 7; returns 0 if either variableA is less than or equal to 5, or if variableB is less than or equal to 7
or   Checks whether any of the conditions are true. Returns true if at least one condition is met and false otherwise. It is often useful to use the "or" function as the first argument of an "if" function, for example, if(or(logical_test1, logical_test2, ...), 1, 0). or(logical_test1, logical_test2, ...) or(variableA>5, variableB >7) returns 1 if variableA is greater than 5, or variableB is greater than 7, or both are true; returns 0 if both variableA is less than or equal to 5, and variableB is less than or equal to 7
not   Changes false to true, or true to false. Used to negate a logical condition. not(logical_test) not(variableA>5) returns 1 if variableA is less than or equal to 5; returns 0 if variableA is greater than 5
abs absolute value Changes all negative numbers to positive numbers. Positive numbers and zero are unchanged. abs(number) abs(-5) returns 5
min minimum Returns the smallest value in a series of numbers, variables, constants, or functions. min(number) min(2, 4, 6, 8, 10) returns 2
max maximum Returns the largest value in a series of numbers, variables, constants, or functions. max(number) max(2, 4, 6, 8, 10) returns 10
round   Rounds a value to a specified number of decimal places. Round accepts negative arguments. When a second argument is not entered, 0 is used. round(number, num_digits)

round(103.058, 2) returns 103.06

round(103.058, -2) returns 100

round(103.058) returns 103

degrees Converts angles measured in radians to degrees. degrees(number) deg(1.5) returns 86º