Thursday, July 17th, 2008...5:45 am
Single Row Numeric Functions In Oracle
These functions operate on numeric data and perform some kind of mathematical or arithmetic manipulation. All of these functions take numeric arguments and return numeric values. The trigonometric functions operate on radians, not on degrees. Some of the numeric functions available in oracle are:
ABS: ABS(n) takes a single argument where n is a number. This function returns the absolute value of n.
Select ABS (-10) negative,
ABS (10) positive
from dual;
ACOS: ACOS(n) takes a single argument, where n is a number between -1 and 1. This function returns the arc cosine of number expressed in radians, accurate to 30 digits of precision.
Select ACOS (1) from dual;
ASIN: ASIN (n) takes a single argument, where n is a number between -1 and 1. This function returns the arc sine of n expressed in radians, accurate to 30 digits of precision.
Select ASIN (0) from dual;
ATAN: ATAN(n) takes a single argument where n is a number. This function returns the arc tangent of n expressed in radians, accurate to 30 digits of precision.
Select ATAN (0) from dual;
ATAN2 (n1, n2): This function takes two arguments where n1 and n2 are numbers. This function returns the arc tangent of n1, and n2 expressed in radians, accurate to 30 digits of precision. ATAN2 (n1, n2) is equivalent to ATAN (n1/n2).
BITAND: BITAND (n1, n2) takes two arguments and it performs a bitwise AND operation on the two numbers and returns the result which is an integer. This function is used to examine the bit fields.
CEIL: CEIL (n) takes a single argument where n is a number and it returns the smallest integer that is greater than or equal to n. This function rounds up a whole number.
Select CEIL (2.5) from dual;
COS: COS (n) takes a single argument where n is a number. This function returns the arc cosine of n expressed in radians, accurate to 30 digits of precision.
Select COS (180) from dual;
COSH : COSH (n) takes a single argument, where n is a number and it returns the hyperbolic cosine of n, accurate to 36 digits of precision.
Select COSH (2.5) from dual;
FLOOR: FLOOR (n) takes a single argument, where n is a number. This function rounds the whole number.
Select FLOOR (2.5), FLOOR (1876) from dual;
LOG: LOG (n1, n2) takes two arguments where n1 and n2 are numbers. This function returns the logarithm base n1 of n2 accurate to 36 digits of precision.
Select LOG (9, 18) from dual;
EXP: EXP (n) takes a single argument where n is a number. This function returns the exponential value of number.
Select EXP (1) form dual;
SIN: SIN (n) takes a single arguments, where n is a number. This function returns the arc sine of n expressed in radians, accurate to 36 digits of precision.
Select SIN (1.57079) from dual;
SINH : SINH (n) takes a single argument where n is a number and it returns the hyperbolic sine of n, accurate to 36 digits of precision.
SQRT : SQRT (n) takes a single argument where n is a number. This function returns the square root of n.
Select SQRT (81) from dual;
TAN : TAN (n) takes a single argument where n is a number. This function returns the arc tangent of n expressed in radians, accurate to 36 digits of precision.
Select TAN (1) from dual;
TANH : TANH (n) take a single argument where n is a number. This function returns the hyperbolic tangent of n, accurate to 36 digits of precision.
SIGN : SIGN (n) takes a single argument, where n is a number. This function returns -1 if n is negative, and 1 if n is positive and 0 if n is 0.
Select Sign (0) from dual;
Leave a Reply