Oracle Numeric type functions

Source: Internet
Author: User
Tags abs numeric square root
1.ABS (x)
[Function] Return the absolute value of x
[Parameter] x, numeric expression
【Back】 Number
[Example] select abs (100), abs (-100) from dual;
2.sign (x)
[Function] Return the positive and negative values of x
[Parameter] x, numeric expression
【Return】 Number, if it is positive value, return 1, negative value returns -1, 0 returns 0
[Example] select sign (100), sign (-100), sign (0) from dual;
3.ceil (x)
[Function] Return the smallest integer value greater than or equal to x
[Parameter] x, numeric expression
【Back】 Number
[Example] select ceil (3.1), ceil (2.8 + 1.3), ceil (0) from dual; returns 4, 5, 0
4.floor (x)
[Function] Return the largest integer value less than or equal to x
[Parameter] x, numeric expression
【Back】 Number
[Example] select floor (3.1), floor (2.8 + 1.3), floor (0) from dual; returns 3, 4, 0
5.power (x, y)
【Function】 Return x to the y power
[Parameter] x, y numeric expression
【Back】 Number
[Example] select power (2.5, 2), power (1.5, 0), power (20, -1) from dual; return: 6.25, 1, 0.05
6.exp (y)
【Function】 Return e to the y power (e is a mathematical constant)
[Parameter] y, numeric expression
【Back】 Number
[Example] select exp (3), exp (0), exp (-3) from dual; return: 20.0855369,1, 0.049787068
7.mod (x, y)
[Function] Return the remainder of x divided by y
[Parameter] x, y, numeric expression
【Back】 Number
[Example] select mod (23,8), mod (24,8) from dual; return: 7,0
8.round (x [, y])
【Function】 Return the rounded value
[Parameters] x, y, a numeric expression. If y is not an integer, the integer part of y is intercepted. If y> 0, it is rounded to y decimal places. If y is less than 0, it is rounded to the y digit to the left of the decimal point.
【Back】 Number
[Example] select round (5555.6666, 2.1), round (5555.6666, -2.6), round (5555.6666) from dual; return: 5555.67, 5600, 5556
9.trunc (x [, y])
[Function] Return the value of x intercepted by precision y
[Parameter] x, y, numeric expression, if y is not an integer, intercept the integer part of y, if y> 0, intercept the y decimal, if y is less than 0, intercept the decimal point to the left y digit, before the decimal Other data is represented by 0.
【Back】 Number
[Example] select trunc (5555.66666,2.1), trunc (5555.66666, -2.6), trunc (5555.033333) from dual; return: 5555.66 5500 5555
10.sqrt (x)
[Function] Returns the square root of x
[Parameter] x numeric expression
【Back】 Number
[Example] select sqrt (64), sqrt (10) from dual; return: 8, 3.16227766
————————————————
Copyright statement: This article is an original article of CSDN blogger "qq_43628487", which follows the CC 4.0 BY-SA copyright agreement. Please attach the original source link and this statement when reprinting.
Original link: https://blog.csdn.net/qq_43628487/java/article/details/86647432
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.