Math Functions


Function

Description

Abs(Arg1)

Returns the absolute value of Arg1. The argument and the result are of type real.

ACos(Arg1)

Returns the arccosine of Arg1 as an angle expressed in radians in the interval [0 ,p ]. Arg1 must be in the interval [-1.0, 1.0], otherwise #NA is returned. The argument and the result are of type real.

ASin(Arg1)

Returns the arcsine of Arg1 as an angle expressed in radians in the interval [- p /2 , p /2]. Arg1 must be in the interval [-1.0, 1.0], otherwise #NA is returned. The argument and the result are of type real.

ATan(Arg1)

Returns the arctangent of Arg1 as an angle expressed in radians in the interval [-p /2 , p /2]. The argument and the result are of type real.

ATan2(Arg1, Arg2)

Returns the arctangent of two arguments (y, x) as an angle expressed in radians (in the interval -PI and PI). Arg1 is the y-coordinate and Arg2 the x-coordinate. The signs of the arguments are used to determine the quadrant of the result. The arguments and the result are of type real.

 

Example:

ATan2(0, -1)   → 3.14159265358979

Ceiling(Arg1)

Rounds Arg1 up to the nearest whole number. The argument and the result are of type real.

 

Examples:  
Ceiling(1.01)       → 2.0
Ceiling(-1.99)      → -1.0

Cos(Arg1)

Returns the cosine of Arg1 where Arg1 is an angle expressed in radians. The argument and the result are of type real.

Exp(Arg1)

Returns e (2.718281...) raised to the Arg1 power. The argument and the result are of type real.

Floor(Arg1)

Rounds Arg1 down to the nearest whole number. The argument and the result are of type real.

 

Examples:
Floor(1.99)      → 1.0
Floor(-1.01)     → -2.0

Ln(Arg1)

Returns the natural logarithm of Arg1. The arguments and the result are of type real. If Arg1 is negative, the result is a #NA error. If Arg1 is zero, the result is also #NA.

Log(Arg1, Arg2)

Returns the logarithm of Arg1 expressed in the base specified by Arg2. Equivalent to Ln(Arg1)/Ln(Arg2). The arguments and the result are of type real. See function Ln for the definition of valid arguments.

Log10(Arg1)

Returns the 10-based logarithm of Arg1. Equivalent to Ln(Arg1)/Ln(10). The arguments and the result are of type real. See function Ln for the definition of valid arguments.

Mod(Arg1, Arg2)      

Returns the reminder of the division of Arg1 by Arg2, The arguments and the result are of type real. If Arg2 is 0, the result is a  #NA error.

Mod(Arg1, Arg2) is defined as:
Arg1 – Arg2*Floor(Arg1/Arg2)

PI()

Returns the numerical constant p .

The result is of type real.

Power(Arg1, Arg2)

Returns Arg1 raised to the Arg2 power. The arguments and the result are of type real.

If Arg1 is a negative number, then Arg2 must be an integer, since imaginary numbers are not supported.

 

Examples:
Power(10, 3)    → 1000
Power(10, -3)   → 0.001
Power(0, 0)       → 1

Product(Arg1, ...)

Calculates the product of the values. If one argument is given, then the result is the product of the entire column. If more than one column is given, then the result is the product of each row.

The arguments and the result are of type real. Null arguments are ignored and do not contribute to the product.

Examples:

Product([Column])

Product(1,2,3)             →  6

Product(-1)                  → -1
Product(1.5, -2, 3)      → -9
Product(1, null, 3)      → 3
Product(null)               → (Empty)

Rand(Arg1)

Returns a random real number between 0.0 and 1.0.

The integer argument is a constant seed value that is used to initialize the random number generator. It also assures that the same values are generated if the column is recalculated.

The seed value cannot be a column reference.

 

Example:

Rand(147)

RandBetween(Arg1, Arg2, Arg3)

Returns a random integer number within the specified range.

The first and the second arguments set the range for the random numbers. These arguments can be constant values or integer column references.

The third argument is a constant seed value that is used to initialize the random number generator. It also assures that the same values are generated if the column is recalculated.

The seed value cannot be a column reference.

Example:

RandBetween(100, -100, 147)

RandBetween(0, [Column 1], 147)

RandBetween([Column 1], [Column 2], 37)

Round(Arg1, Arg2)

Used to round up Arg1 to the number of decimal places specified by Arg2. The arguments and the result are of type real, but for Arg2, only the integer part is used. Note that Arg2 can be negative to round to even 10s, 100s, etc.

0.5 is rounded upwards to a number with higher magnitude (ignoring the sign).

 

Examples:
Round(PI(), 3)     → 3.142
Round(-0.5, 0)     → -1
Round(25, -1)      → 30

Sin(Arg1)

Returns the sine of Arg1 where Arg1 is an angle expressed in radians. The argument and the result are of type real.

Sqrt(Arg1)

Returns the square root of Arg1. The argument and the result are of type real. If Arg1 is negative, the result is a #NA error.

Sum(Arg1, ...)

Calculates the sum of the values. If one argument is given, then the result is the sum of the entire column. If more than one column is given, then the result is the sum of each row.

Null arguments are ignored and do not contribute to the sum.

 

Examples:

Sum([Column])

Sum(1,2,3)           → 6
Sum(-1)                → -1
Sum (1.5, -2, 3)   → 2.5
Sum (1, null, 3)   → 4
Sum (null)            → (Empty)

Tan(Arg1)

Returns the tangent of Arg1 where Arg1 is an angle expressed in radians. The argument and the result are of type real.

See also:

Binning functions

Conversion functions

Date and Time functions

Keywords

Logical functions

OVER functions

Property functions

Ranking functions

Spatial functions

Statistical functions

Text functions