O'Reilly logo

Oracle PL/SQL Programming, Third Edition by Bill Pribyl, Steven Feuerstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Numeric Functions

PL/SQL implements a number of functions that are useful when working with numbers. We list those functions in Table 9-6, and describe each of them in detail in the sections that follow.

Table 9-6. PL/SQL’s built-in numeric functions

Name

Description

ABS

Returns the absolute value of a number.

ACOS

Returns the inverse cosine.

ASIN

Returns the inverse sine.

ATAN

Returns the inverse tangent.

ATAN2

Returns the inverse tangent of a value, but allows you to pass that value differently than when using ATAN.

BITAND

Performs an AND operation on the bits from two positive integer numbers.

CEIL

Returns the smallest integer greater than or equal to the specified number.

COS

Returns the cosine.

COSH

Returns the hyperbolic cosine.

EXP (n)

Returns the number e raised to the nth power, where e = 2.71828183...

FLOOR

Returns the largest integer equal to or less than the specified number.

LN (a)

Returns the natural logarithm of a.

LOG (a, b)

Returns the logarithm, base a, of b.

MOD (a, b)

Returns the remainder of a divided by b.

POWER (a, b)

Returns a raised to the bth power.

ROUND (a, [b])

Returns a rounded to b decimal places.

SIGN (a)

Returns 1 if a is positive, 0 if a is 0, and -1 if a is less than 0 (i.e., negative).

SIN

Returns the sine.

SINH

Returns the hyperbolic sine.

SQRT

Returns the square root of a number.

TAN

Returns the tangent.

TANH

Returns the hyperbolic tangent.

TRUNC (a, [b])

Returns a truncated to b decimal ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required