Returns the magnitude of a real number, ignoring its positive or negative sign.
This function can only calculate with numbers. In all other cases, it returns zero.
number uAbs(value)
A number to calculate on.
To calculate the absolute value:
uAbs(1522) // returns 1522
uAbs(‘-123.45’) // returns 123.45
uAbs(‘123ABC’) // returns 0
Returns the least integer greater than or equal to argument.
number uCeil(value);
A number to calculate on.
To round up numbers:
uCeil(1523.1) // returns 1524
uCeil(1522.9) // returns 1524
Returns the division integer.
number uDiv(value)
A number to calculate on.
To calculate the integer:
uDiv(10, 3) // returns 3
Returns the exponential, base e.
number uExp(value)
A number to calculate on.
To calculate an exponential:
uExp(1) ;; returns "2.718281828459045"
Returns the greatest integer less than or equal to argument.
number uFloor(value)
A number to calculate on.
To round up numbers:
uFloor(1523.1) ;; returns 1523
uFloor(1523.9) ;; returns 1523
Returns the natural logarithm (base E) of a number.
number uLn(input);
A number to calculate on.
uLn(2.718281828) // returns 0.999999
Returns the logarithm of a number. If the base parameter is omitted, a base of 10 is taken.
number uLog(value [, base])
A number to calculate on.
The base for the logarithm. If omitted, a base of 10 will be used.
uLog(100) // returns 3 uLog(16, 2) // returns 4
Returns the modulo of a division.
number uMod(value)
A number to calculate on.
To calculate the modulo:
uMod(10, 3) // returns 1
Returns the value of a base expression taken to a specified power.
number uPow(value)
A number to calculate on.
uPow(10, 3) ;; returns "1000"
Returns a random number greater than or equal to zero and smaller than one.
number uRandom(value)
A number to calculate on.
To return a random number:
uRandom() // returns "0.696654639123727”
Returns the rounded argument to nearest integer. If the second optional parameter is set, uRound preserves the specified number of digits behind the decimal point.
number uRound(value, scale)
A number to calculate on.
Number of digits.
To round numbers:
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"
Returns the sign of a given value
number uSgn(value)
A number to calculate on.
To detecting the sign of a given value:
uSgn(-10.4) // returns -1
uSgn(0) // returns 0
uSgn(10.4) // returns 1
uSgn(null) // returns null
Returns the square root of a given value.
number uSqrt(value)
A number to calculate on.
To calculate a square root:
uSqrt(25) // returns 5
uSqrt(0) // returns 0
uSqrt(null) // returns null