Oracle 10 Gb functions-numeric Functions

Source: Internet
Author: User
Tags natural logarithm

ABS (x)[Function] returns the absolute value of x. [parameter] x, number expression. [Return] number. [Example] select abs (100), abs (-100) from dual;

Sign (x)[Function] returns the positive and negative values of x. [parameter] x, number expression [Return] number. If the return value is positive, 1 is returned. If the return value is negative,-100 is returned. [Example] select sign ), sign (-100), sign (0) from dual;

Ceil (x)[Function] returns the smallest integer value greater than or equal to x [parameter] x, numeric expression [Return] Number [Example] select ceil (3.1), ceil (2.8 + 1.3 ), ceil (0) from dual; returns 4, 5, 0

Floor (x)[Function] returns the maximum integer less than or equal to x [parameter] x, numeric expression [Return] Number [Example] select floor (3.1), floor (2.8 + 1.3 ), floor (0) from dual; returns 4, 5, 0

Power (x, y)[Function] returns the y power of x. [parameter] x, y numeric expression. [Return] number. [Example] select power (2.5, 2), power (1.5, 0 ), power (20,-1) from dual; returns: 6.25, 1, 0.05 [close] exp (y) returns the power y of e. (E is a mathematical constant) [relational] z = power (x, y), then y = 1/log (z, x) (condition z, x> 0)

Exp (y)[Function] returns the y Power of e (e is a mathematical constant) [parameter] y, numeric expression [Return] Number [Example] select exp (3), exp (0 ), exp (-3) from dual; returns: 20.0855369, 1, 0.049787068 [close] power (x, y) returns the power y of e. [Opposite] ln (y) returns the Base natural logarithm of e.
Log (x, y)[Function] returns the base-x logarithm of y. [parameter] x, y, numeric expression, [condition] x, y must be greater than 0 [Return] Number [Example] select power (0.25), log (), 1/log () from dual; Return: 16, 2 select power (6.5, 3), log (274.625, 3), 1/log (power (6.5, 3), 6.5) from dual; Return: 274.625, 0.195642521, 3 [close] ln (y) returns the base y logarithm of e. (E is a mathematical constant) [relational] z = power (x, y), then y = 1/log (z, x) (condition z, x> 0)

Ln (y)[Function] returns the logarithm of y Based on e (e is a mathematical constant). [parameter] y, numeric expression (condition y> 0) return number [Example] select exp (3), exp (-3), ln (20.0855369), ln (0.049787068) from dual; Return: 20.0855369, 0.049787068, 3, -3 [close] log (x, y) returns the logarithm of y based on x. [opposite] exp (y) returns the y Power of e.

Mod (x, y)[Function] returns the remainder of x divided by y. [parameter] x, y, numeric expression [Return] Number [Example] select mod (), mod () from dual; return: 7, 0

Round (x [, y])Function: returns the rounded value. [parameter] x, y, numeric expression. If y is not an integer, the integer y is truncated. If y is greater than 0, the rounded value is y, if y is less than 0, it is rounded to the y place to the left of the decimal point. Return number [Example] select round (5555.6666, 2.1), round (5555.6666,-2.6), round (5555.6666) from dual; Return: 5555.67, 5600,555 6 [close] trunc (x [, y]) returns the truncated value, which is used in the same way as round (x [, y]), but is not rounded down.
Trunc (x [, y])[Function] returns the x, y, numeric expression after x is truncated by precision y. If y is not an integer, the y integer is truncated, if y> 0, it is truncated to y decimal places. If y is smaller than 0, it is truncated to y decimal places on the left. Other data before decimal places is represented by 0. Return number [Example] select trunc (5555.66666, 2.1), trunc (5555.66666,-2.6), trunc (5555.033333) from dual; return: 5555.66 5500 5555 [close] round (x [, y]) returns the truncated value. The usage is the same as that of trunc (x [, y]), but only rounding
Sqrt (x)[Function] returns the square root of x. [parameter] x number expression. [Return] number. [Example] select sqrt (64), sqrt (10) from dual. Return: 8, 3.16227766.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.