Numeric Functions

Updated July 2016; see History

These functions all return numeric values, although some may operate on string arguments.

Function

Description

ABS(x)

Returns absolute value of x.

EXP(x)

Returns the constant e (2.718218285) raised to the power x.

FACT(x)

Returns the factorial of x.

FIX(x)

Returns the integer part of the floating point value x.

INT(x)

Returns the largest integer less than or equal to x. (FIX(x) and INT(x) are same for positive numbers, but differ for negative numbers.)

LEN(a$)

Returns length of string A$. Note that if a$ is actually a variable of type x, the returned length will always be the physical mapped size of the variable. Otherwise, for strings (type S), the returned length will be determined by the first null byte or the physical mapped length, whichever is smaller.

LOG(x)

Returns the natural (base e) log of x.  

LOG10(x)

Returns the decimal logarithm of x.

NUMEXPR

See in String Functions.

RND(x)

Returns a random number.

RND2()

Enhanced version of RND(x).

SRND2(x...)

Initializes the RND2() generator.

SGN(x)

Returns the sign of x: -1 if x < 0, 0 if x = 0, 1 if x > 0.

SQR(x)

Returns the square root of x.

VAL(x)

See in String Functions.

 

History

2016 July, A-Shell 6.3.1517:  Add second random number generator, RND2 and SRND2.