Functions that return numeric values (although not necessarily ones that require numeric arguments).
Returns the sign of the parameter value. Returns 1 if the value is greater than zero , zero if equal to zero. -1 if negative.
Returns the absolute value of x
.
Returns the integer value of x
. Truncates toward negative infinity. The absolute value of x
must be less than 2^31-1. The usage int(x, 0)
truncates towards zero.
Returns the integer value of x
. Truncates toward negative infinity.
Returns the square root of x
.
Returns the natural logarithm of x
.
Returns the logarithm base 10 of x
.
Returns e^x
. e=2.7182818...
Trigonometric functions: sin, cosine and arctangent.
Returns pi, 3.141592653589793...
Returns an integer pseudo-random number between 0 and int(EXPR)-1
inclusive. If EXPR
is 1, then returns a rational number between 0 (inclusive) and 1. If EXPR
is negative then EXPR
seeds the random number generator.
Seeds the random number generator with the integer EXPR
. The pseudo-random number generator should return the same sequence when seeded with the same start value. The actual sequence may be system dependant.
Returns the length of the string STRINGEXPR
.
Returns the length, in bytes, of a typed record (one created by DIM AS NEW
).
Value of the expression contained in a STRINGEXPR
or EXPR
. STRINGEXPR
may be a string literal, variable, function, or expression.
For example, VAL("1 + sqr(4)")
yields 3.
Returns the ascii code for the first character of STRINGEXPR
. A null string returns zero.
Returns the position of the substring b$
in the string a$
or returns a zero if b$
is not a substring. VAL
is an optional starting position in a$
.
If VAR
is a dimensioned array, returns the maximum legal subscript of the first dimension of that array, else returns 0. Use EXPR
to return other dimensions.
If VAR
is a dimensioned array, returns the number of dimensions, otherwise returns 0.
Reads one byte from the open file specified by FILENUM
and returns an unsigned numeric value [0..255].
Returns true if the the last INPUT
statement, INPUT$
or FGETBYTE
function call which referenced the text file specified by FILENUM
tried to read past the end of file. (Note that reading the last line of a file will not read past the eof mark. A subsequent read is needed to set the EOF
flag to true. Reading past the end-of-file will not report an error.)
POP
function (see also POP
statement). Pops one variable value off the stack and returns that value (string or numeric).
(POP
can be used as either a statement (with a parameter) or a function (no parameter). Note that the POP
function, unlike the POP
statement, does not restore the value of the variable pushed, but only returns the pushed value. This use of the POP
statement is different from the Applesoft usage.)
Returns the value of the byte in memory at address ADDR
. If SIZE_VAL
is 2 or 4, returns the value of the 16-bit or 32-bit word respectively (if correctly aligned). If SIZE_VAL
is 8, returns the value of the numeric variable located at ADDR
. (peek(varptr(x),8) == x
)
Returns the memory address of a variable.
Returns the line number of the last error. Zero if the error was in immediate mode. The variable errorstatus$
gives the error type.
Returns a numeric value of elapsed of seconds from the computer's internal clock.