Javascript mathematical functions and javascript mathematical functions

Source: Internet
Author: User
Tags natural logarithm

Javascript mathematical functions and javascript mathematical functions

Javascript mathematical functions are actuallyMath objectIt consists of attributes and functions (or methods. The attributes mainly include the following:

   Math. e: E (natural logarithm ),Math. LN2(Natural logarithm of 2 ),Math. LN10(The natural logarithm of 10 ),Math. LOG2E(Logarithm of e, base number 2 ),Math. LOG10E(Logarithm of e, base number is 10 ),Math. PI(π ),Math. SQRT1_2(The square root of 1/2 ),Math. SQRT2(The square root of 2 ).

The following 18 functions are available:

(1)AbsFunction: that is, Math. abs (the same as below), returns the absolute value of a number.

(2)AcosFunction: returns the arc cosine of a number. The result is 0 ~ π radians (radians ).

(3)AsinFunction: returns the arc sine of a number. The result is-π/2 ~ π/2 radian.

(4)AtanFunction: returns the arc tangent of a number. The result is-π/2 ~ π/2 radian.

(5)Atan2Function: returns the Polar Coordinate angle value of a coordinate.

(6)CeilFunction: returns the smallest integer (greater than or equal to) of a number ).

(7)CosFunction: returns the cosine of a number. The result is-1 ~ 1.

(8)ExpFunction: returns the multiplier value of e (natural logarithm.

(9)FloorFunction: returns the maximum integer (less than or equal to) of a number ).

(10)LogFunction: natural logarithm function, which returns the natural logarithm (e) value of a number.

(11)MaxFunction: returns the maximum value of two numbers.

(12)MinFunction: returns the minimum value of two numbers.

(13)PowFunction: returns the multiplier value of a number.

(14)RandomFunction: returns a value ranging from 0 ~ A random value of 1.

(15)RoundFunction: returns the rounding value of a number. The type is an integer.

(16)SinFunction: returns the sine of a number. The result is-1 ~ 1.

(17)SqrtFunction: returns the square root of a number.

(18)TanFunction: returns the tangent of a number.

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.