NAME

abs - compute the absolute value

SYNOPSIS

val.abs()

DESCRIPTION

The abs() method computes the absolute value of the given val. If val is an arithmetic scalar or if it a packed arithmetic array, the result has the same type as val. If val is a List or Array and if each element of val is an arithmetic type, then a packed array will be created based on packing rules (see pack for more information).

RETURN VALUE

A value or array which is the absolute value of the given val

ERRORS

TypeCheck if any portion of val is not arithmetic

EXAMPLE

    a = {-1.5, 0, 3.5}
    a.abs()
1.5 0. 3.5

SEE ALSO

pack