MySQL Database operations 6-function 1-Mathematical functions

Source: Internet
Author: User
Tags base 10 logarithm mathematical functions natural logarithm rand square root

1. Absolute and pi

ABS (x) and pi ()

2. square Root and seeking remainder

sqrt (x) and mod (y), where y is dividend

3. Getting integers from a small number

Ceil (x), ceiling (x) returns the smallest integer not less than X

Floor (x) returns the largest integer less than x

4. Get random numbers

RAND () returns the random number generated between 0-1

RAND (x) returns a random number that is seeded with X, in principle the same x generates the same random number

5. Rounding function

Round (x) returns the X value after rounding

Round (x, y) returns the y bit after the decimal point, when Y is negative, the left of the decimal point is reserved.

Truncate (x, y), remove all values after the Y-position to the right of the decimal point, and Y as negative to the left of the decimal point

6. The symbol that returns the value

sign (x) returns the symbol for x, positive, negative, return 1,-1, return 0 for 0 o'clock

7. Power function

Pow (x, y), power (x, y) returns the Y power of X

EXP (x) returns the X-power of the natural number E

8. Logarithm

Log (x) returns the natural logarithm of X

LOG10 (x) returns the base 10 logarithm

9. Angle and radians convert each other

radians (x) converts x to radians, X for angle

Degrees (x) converts x to angle, x to radians

10. Trigonometric Functions

Sin (x)

ASIN (x)

COS (x)

ACOs (x)

Tan (x)

Atan (x)

Cot (x)

Learn math is, all know what function, the front plus a is the inverse function. Note the range of function values.

MySQL Database operations 6-function 1-Mathematical functions

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.