MySQL math function

Source: Internet
Author: User
Tags abs natural logarithm rand square root value of pi
First, ABS

ABS (x)

Returns the absolute value of X

Second, Bin/oct/hex

BIN (x)

Returns the binary of X (Oct returns octal, HEX returns hex)

Third, Ceiling/floor

CEILING (x): Returns the smallest integer value greater than X

Floor (x): Returns the maximum integer value less than x

Four, EXP

EXP (x)

The X-square of the return value E (the base of the natural logarithm)

Wu, Greatest/least

Greatest (x1,x2,..., xn): Returns the largest value in the collection
LEAST (x1,x2,..., xn): Returns the smallest value in the collection

VI, LN

LN (x)

Returns the natural logarithm of X

Seven, LOG

LOG (x, y)

Returns the Y-base logarithm of X

Eight, MOD

MOD (x, y)

Returns the modulus (remainder) of x/y

Nine, PI

PI ()

Returns the value of Pi (pi)

Ten: RAND

RAND ()

Returns a random value from 0 to 1, which enables the rand () random number generator to generate a specified value by providing a parameter (seed).

Xi. ROUND

ROUND (x, y)

Returns the rounding of parameter x with a value of y decimal place

12, TRUNCATE

TRUNCATE (x, y)

Returns the result of a number x truncated to Y decimal places

13. Sign

Sign (x)

Returns the value of the symbol representing the number X

14, SQRT

SQRT (x)

Returns the square root of a number

MySQL math function

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.