A newer version of Max is available. Click here to access the latest version of the documentation

abs Reference

Calculate an absolute value

abs

Description

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

Examples

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

Arguments

format [number]

Optional

Float argument forces a float output.

Attributes

Common Box Attributes

Messages

int

Arguments

input [int]
The absolute (non-negative) value of the input is sent out the output.

float

Arguments

input [float]
Converted to int, unless abs has a float argument.

Output

float

Floats are output only if there is an argument with a decimal point.

int

The absolute value of the input.

See Also

Name Description
expr