Darwin Help

Back to Index

abs

Function abs - absolute value

Calling Sequence  |x|
abs(x)
Parameters
NameTypeDescription

x numerican expression
Return Type  numeric
Synopsis This function computes the absolute value of a number. Two syntaxes are available, the functional one, abs(x) or the mathematical with vertical bars: |x|. Please note that |x|, when x is an array is not the norm of the vector, but the vector of the absolute values.
Examples
> |-0.3|;
0.3000
> abs(cos(3));
0.9900
> |[-1,-2,-3]|;
[1, 2, 3]