Name

abs — Return the absolute value of a number

Synopsis

abs ( in num any );
 

Description

abs returns the absolute value of its argument.

Parameters

num

Numeric value whose absolute value is to be returned

Return Types

Same as parameter type.

Examples

Example 24.11. Simple example

Get absolute values of several numeric values

SQL> select cast (abs (-2.343) as numeric),
  cast(abs (0) as numeric),
  cast (abs (3.1415) as numeric);

callret          callret         callret
DECIMAL          DECIMAL         DECIMAL
_________________________________________

2.343            0               3.1415

1 Rows. -- 5 msec.