Algebraic Functions
Algebraic functions take one or more arguments of numeric data
types. Besides supporting numeric arguments, the CEIL and FLOOR functions
can also take character string arguments that can be converted to
DECIMAL values, and the ROUND and TRUNC functions can
also take DATE or DATETIME arguments.
Algebraic Functions
{ { ABS | CEIL | FLOOR } (num_expression) | GREATEST( expression ,expression+--) | LEAST( expression ,expression+--) | MOD(dividend, divisor ) | { POW | POWER } (base, exponent) | ROOT(radicand [ { , 2 | , index } ] ) | { ROUND | TRUNC } ( { num_expression | date_expression } [ { , 0 | , factor } ] ) | { ROUND | TRUNC } (date_expression [ , ' { DD | DAY | MONTH | YEAR } ' ] ) | { ROUND | TRUNC } (datetime_expression [ { , 'DD' | , ' { MI | HH | DAY | MONTH | YEAR } ' } ] ) | SQRT( sqrt_radicand) }
Element | Description | Restrictions | Syntax |
---|---|---|---|
base | Value to be raised to the power specified in exponent | Must return a real number | Expression |
date_expression | Expression that evaluates to (or is cast to) a DATE value | Must return a DATE value | Expression |
datetime_expression | Expression that evaluates to (or is cast to) a DATETIME value | Must return a DATETIME value | Expression |
dividend | Value to be divided by divisor | A real number | Expression |
divisor | Value by which to divide dividend | A nonzero real number | Expression |
exponent | Power to which to raise base | A real number | Expression |
factor | Number of significant digits to replace with zero in the returned value. Default is to return the rounded or truncated integer part of the first argument. | Integer in range +32 to -32. Positive or unsigned values are applied to the right of the decimal point, and negative values are applied to the left. | Literal Number |
index | Root to extract. The default is 2. | A nonzero real number | Expression |
num_expression | Expression that evaluates to (or is cast to) a numeric value | A real number | Expression |
radicand | Value whose root is to be returned | A real number | Expression |
sqrt_radicand | Number with a real square root | A nonnegative real number | Expression |