Oracle Fundamentals (12) Math functions

Source: Internet
Author: User
Tags bitwise cos mathematical functions sin square root

Mathematical functions:

ABS (n): Seek absolute value

SELECT ABS (-),ABS(from DUAL;   -- get the absolute result of 15 :

Bitand (x, y): Returns x, Y for bitwise AND (and) results

SELECTBitand (1,0), Bitand (0,1), Bitand (0,0), Bitand (1,1), Bitand (1100,1010) fromDUAL;--returns the result of a bitwise and (and) operation on X, yResults:0,0,0,1, -

Ceil (n): Rounding up

SELECT Ceil (44.123), Ceil (-44.123 from dual;    -- Rounding up result: 

Floor (N): Rounding down

SELECT  Floor (44.567),Floor (-44.567 from dual;   -- Rounding down result: 

ROUND (m,n): Rounding

SELECT ROUND(44.567),ROUND(44.123),ROUND(-44.123),ROUND(-44.567) fromDual--RoundingResults: $, -,- -,- $SELECT Round(44.567,2) fromDual--rounded, reserved two decimal placesResults:44.57

TRUNC (m,n): Intercept

SELECTTRUNC (44.567), TRUNC (44.123), TRUNC (-44.123), TRUNC (-44.567) fromDual--truncateResults: -, -,- -,- -SELECTTRUNC (44.567,2) fromDual--truncateResults:44.56

Sign (n): Take symbol

SELECT  Sign (- from dual;       -- take a symbol, a positive number is 1, a negative number is -1,0 for 0 results:1

Sin (n): sine

SELECT SIN (3 from DUAL;      -- 3 sine result:0.141120008059867

COS (n): cosine

SELECT COS (3 from DUAL;      -- 3 cosine Result:-0.989992496600445

POWER (m,n): M's N times of Hades

SELECT POWER (2,8 from dual;    -- 2 of 8-square results:

SQRT (n): Open square root

SELECT SQRT (9 from dual;       -- Open square root result:3

MOD (m,n): Take surplus

SELECT MOD (3 from dual;     -- mod 2 (residual) results:1

Oracle Fundamentals (12) Math functions

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.