VARKON Version 1.15 1997-10-24
abs - Function
Mathematical function
Description
Returns the absolute (positive) value of an argument.
Syntax
abs(x)
INT or FLOAT x;
Principal parameters
x - Any value, INT or FLOAT
Optional parameters
None.
Return value
If x is an INT-value abs returns its absolute value as an INT. If x is a FLOAT value abs returns its absolute value as a FLOAT.
Examples
abs(-100) returns the integer value 100
abs(-100.0) returns the float value 100.0
Comments
The abs function is different from other functions by its dual nature of being both an INT and a FLOAT function. Normal functions have only one type.