abs

Output the absolute value of the input

Description

abs outputs the absolute (non-negative) value of any given number. Floats will be output only if the argument to abs is a float.

Arguments

Name Type Opt Description
number-format int or float opt Float argument forces a float output.

Messages

int input [int]
The absolute (non-negative) value of the input is sent out the output.
float input [float]
Converted to int, unless abs has a float argument.

Information for box attributes common to all objects

Output

float: Floats are output only if there is an argument with a decimal point.
int: The absolute value of the input.

Examples

Output is non-negative........Used here to invert input

See Also

Name Description
expr Evaluate a mathematical expression