Math functions for MySQL

Source: Internet
Author: User

1, the Absolute function abs (x) and return pi function pi (x)

    ABS (x) returns the absolute value of X

Pi () returns the value of Pi, which is shown by default after 6 bits

2, square root function sqrt (x) and the remainder function mod

SQRT (x) returns the two root of a non-negative X

The residual mod (x, y) returns the remainder of X/y, and the MoD () also works with a fraction of the value, which returns the exact remainder after the operation.

3. Functions that get integers ceil (x), CEILING (x), and floor (x)

Ceil (x) and ceiling (x) have the same meaning, return the smallest integer value not less than X, and the return value into a bigint

Floor (x) returns the maximum integer value not greater than X, and the return value is converted to a bigint

4. The function ran () and Rand (X) to get the random number

RAND (X) returns a random floating-point number of V, ranging from 0 to 1

5, function ROUND (x), ROUND, X, Y, and truncate

Round (x) rounding X-values

Round (x, y) retains the Y-bit after the decimal point

Truncate (x, y) intercepts and retains the Y-bit specified after the decimal point

6. Symbol function sign (X)

sign (x), the value of x is negative, 0, or positive returns the corresponding value is-1, 0, 1

7, Power arithmetic function pow (x, y), Power (y) and exp (×)

POW (x, y) and power (x, y) are the Y's to the value of X

EXP (X) is the exponentiation of the calculated E

8. Log function log (x) and LOG10 (x)

This will not have to explain to you!

9. The function radians (x) and degrees (x) that the angle and radians convert to each other

RADIANS (x) is the conversion of x from angle to radians

DEGREES (X) is the conversion of radians to an angle

10, sinusoidal and inverse sine function sin (x) and ASIN (x)

Direct

11. Cosine function cos (x) and inverse cosine function acos (x)

Direct

12, tangent, arc tangent, cotangent function

Direct

Math functions for MySQL

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.