Skip to content

ABS

Absolute Value

This numeric function returns the absolute value of a number.

ABS (numeric-value [,ERR=line-ref|,ERC=error-code])
numeric-value
is any valid number.
line-ref
is the program line number or label to branch to if an error is produced by this function.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.
ABS (Q)

If Q=-22, returns the value 22.
If Q=+22, still returns the value 22.

LET NUMBER=12+ABS (Q*NUM(NUM_STRING$))

If Q=-2 and NUM_STRING$ contains “50”, then NUMBER will be assigned the value 112.

From the Thoroughbred Basic Language Reference, Volume I: A–E, version 8.9.1. Open this page in the PDF