3. Functions


Functions typically consist of a name followed by a list of arguments (or parameter values). The reference section of the help file lists all available functions.

Functions that apply to a single value can be expressed with or without parentheses. For example, there are two ways to use the square root function:

sqrt(4) = 2

sqrt 4 = 2

Functions that apply to two or more argument values require parentheses to group all arguments into a list. Arguments are separated from each other using a semi-colon:

pow(2; 3) = 8

root(3; 8) = 2

fv(10,000; 10 yr; 5%) = 16,470.10

AddUp 2 allows commas to appear as group separators within numbers (or as the decimal mark if you prefer). Using the semi-colon to separate function arguments permits expressions such as:

avg(12,345.67; 89,012.34; 56,789.01) = 52,715.673

A number of AddUp functions take no argument at all and provide either constant values or random values. Constant mathematical values like pi, unit values like the meter and randomly-generated values can be obtained using 0-parameter functions. Parentheses are redundant here; if they are used they must be empty.

pi() = 3.14159

pi = 3.14159

meter() = 1

meter = 1

rnd() = 0.6754207

rnd = 0.9203486

rnd = 0.2459015

<< Back to the overview.