Call Level Interface Guide and Reference

Numeric Functions

The numeric functions in this section are supported by DB2 CLI and defined by ODBC using vendor escape clauses.


Table 190. Numeric Scalar Functions

ABS( numeric_exp )
Returns the absolute value of numeric_exp.

DB2 for common server 2.1     AS/400

ACOS( double_exp )
Returns the arccosine of double_exp as an angle, expressed in radians.

DB2 for common server 2.1     AS/400

ASIN( double_exp )
Returns the arcsine of double_exp as an angle, expressed in radians.

DB2 for common server 2.1     AS/400

ATAN( double_exp )
Returns the arctangent of double_exp as an angle, expressed in radians.

DB2 for common server 2.1     AS/400

ATAN2( double_exp1, double_exp2 )
Returns the arctangent of x and y coordinates specified by double_exp1 and double_exp2, respectively, as an angle expressed in radians.

DB2 for common server 2.1      

CEILING( numeric_exp )
Returns the smallest integer greater than or equal to numeric_exp.

DB2 for common server 2.1      

COS( double_exp )
Returns the cosine of double_exp, where double_exp is an angle expressed in radians.

DB2 for common server 2.1     AS/400

COT( double_exp )
Returns the cotangent of double_exp, where double_exp is an angle expressed in radians.

DB2 for common server 2.1     AS/400

DEGREES( numeric_exp )
Returns the number of degrees converted from numeric_exp radians.

DB2 for common server 2.1     AS/400 3.6

EXP( double_exp )
Returns the exponential value of double_exp.

DB2 for common server 2.1     AS/400

FLOOR( numeric_exp )
Returns the largest integer less than or equal to numeric_exp.

DB2 for common server 2.1     AS/400 3.6

LOG( double_exp )
Returns the natural logarithm of double_exp.

DB2 for common server 2.1     AS/400

LOG10( double_exp )
Returns the base 10 logarithm of double_exp.

DB2 for common server 2.1     AS/400

MOD( integer_exp1, integer_exp2 )
Returns the remainder (modulus) of integer_exp1 divided by integer_exp2.

DB2 for common server 2.1     AS/400

PI()
Returns the constant value of pi as a floating point value.

DB2 for common server 2.1     AS/400

POWER( numeric_exp, integer_exp )
Returns the value of numeric_exp to the power of integer_exp.

DB2 for common server 2.1     AS/400 3.6

RADIANS( numeric_exp )
Returns the number of radians converted from numeric_exp degrees.

DB2 for common server 2.1      

RAND( [integer_exp ] )
Returns a random floating point value using integer_exp as the optional seed value.

DB2 for common server 2.1      

ROUND( numeric_exp, integer_exp. )
Returns numeric_exp rounded to integer_exp places right of the decimal point. If integer_exp is negative, numeric_exp is rounded to | integer_exp | places to the left of the decimal point.

DB2 for common server 2.1      

SIGN( numeric_exp )
Returns an indicator or the sign of numeric_exp. If numeric_exp is less than zero, -1 is returned. If numeric_exp equals zero, 0 is returned. If numeric_exp is greater than zero, 1 is returned.

DB2 for common server 2.1      

SIN( double_exp )
Returns the sine of double_exp, where double_exp is an angle expressed in radians.

DB2 for common server 2.1     AS/400

SQRT( double_exp )
Returns the square root of double_exp.

DB2 for common server 2.1     AS/400

TAN( double_exp )
Returns the tangent of double_exp, where double_exp is an angle expressed in radians.

DB2 for common server 2.1     AS/400

TRUNCATE( numeric_exp, integer_exp )
Returns numeric_exp truncated to integer_exp places right of the decimal point. If integer_exp is negative, numeric_exp is truncated to | integer_exp | places to the left of the decimal point.

DB2 for common server 2.1      


[ Top of Page | Previous Page | Next Page ]