Numeric

Function

Description

uAbs

Returns the magnitude of a real number, ignoring its positive or negative sign

uCeil

Returns the least integer that is greater than or equal to the argument

uDiv

Returns the division integer

uExp

Returns the exponential, base e

uFloor

Returns the largest integer that is less than or equal to the argument

uLn

Returns the natural logarithm (base e) of a number

uLog

Returns the logarithm of a number

uMod

Returns the modulo of a division

uPow, uPower

Returns the value of a base expression raised to a specified power

uRandom

Returns a random number

uRound

Returns the rounded argument to the nearest integer

uSgn

Returns the sign of a given value

uSqrt

Returns the square root of a given value




uAbs

Description

Returns the magnitude of a real number, ignoring its positive or negative sign

Syntax

number uAbs(value)

Parameters

number value

A number to calculate on

Examples

Example 1

uAbs(1522)      // returns 1522
uAbs('-123.45') // returns 123.45
uAbs('123ABC')  // returns 0



uCeil

Description

Returns least integer greater than or equal to argument

Syntax

number uCeil(value)

Parameters

number value

A number to calculate on

Examples

Example 1

Round up numbers:

uCeil(1523.1) // returns 1524
uCeil(1523.9) // returns 1524



uDiv

Description

Returns the division integer

Syntax

number uDiv(value, divisor)

Parameters

number value

A number to calculate on

number divisor

The divisor of the division

Examples

Example 1

uDiv(10, 3) // returns 3



uExp

Description

Returns the exponential, base e

Syntax

number uExp(value)

Parameters

number value

A number to calculate on

Examples

Example 1

uExp(1) // returns "2.718281828459045"



uFloor

Description

Returns greatest integer less than or equal to argument

Syntax

number uFloor(value)

Parameters

number value

A number to calculate on

Examples

Example 1

uFloor(1523.1) // returns 1523
uFloor(1523.9) // returns 1523



uLn

Description

Returns the natural logarithm (base e) of a number

Syntax

number uLn(value)

Parameters

number value

A number to calculate on

Examples

Example 1

uLn(2.718281828) // returns 0.999999



uLog

Description

Returns the logarithm of a number

Syntax

number uLog(value [, base])

Parameters

number value

A number to calculate on

number base (optional)

The base for the logarithm. If omitted, a base of 10 is used.

Examples

Example 1

uLog(100) // returns 2
uLog(16, 2) // returns 4



uMod

Description

Returns the modulo of division

Syntax

number uMod(value, divisor)

Parameters

number value

A number to calculate on

number divisor

The divisor of the division

Examples

Example 1

uMod(10, 3) // returns 1



uPow, uPower

Description

Returns the value of a base expression taken to a specified power

Syntax

number uPow(value, exponent)

Parameters

number value

A number to calculate on

number exponent

A number to be used as the exponent

Examples

Example 1

uPow(10, 3) // returns 1000



uRandom

Description

Returns a random number

Syntax

number uRandom()

Examples

Example 1

Random numbers

uRandom() // returns a value like "0.696654639123727"



uRound

Description

Returns the rounded argument to nearest integer

Syntax

number uRound(value [, scale])

Parameters

number value

A number to calculate on

number scale (optional)

Number of digits

Examples

Example 1

uRound(10.1) // returns "10"
uRound(10.49) // returns "10"
uRound(10.5) // returns "11"
uRound(10.9) // returns "11"
uRound(1.235, 2) // returns "1.24"



uSgn

Description

Returns the sign of a given value

Syntax

number uSgn(value)

Parameters

number value

A number to calculate on

Examples

Example 1

uSgn(-10.4) // returns -1
uSgn(0)     // returns 0
uSgn(10.4)  // returns 1
uSgn(null)  // returns null



uSqrt

Description

Returns the square root of a given value

Syntax

number uSqrt(value)

Parameters

number value

A number to calculate on

Examples

Example 1

uSqrt(25)   // returns 5
uSqrt(0)    // returns 0
uSqrt(null) // returns null