Js--math The property method of the object __js

Source: Internet
Author: User
Tags numeric value square root value of pi
Properties of the Math object:
Call method: Math. Method Name ();
MATH.E: Returns the value of Euler constant E.
MATH.LN2: Returns the logarithm of the natural number 2.
MATH.LN10: Returns the logarithm of the natural number 10.
Common methods:
Math.log (N): Returns the logarithm of the natural number of N.
MATH.LOG2E: Returns the logarithm of 2, E, where 2 is mutable and any n.
Math.PI: Returns the value of PI.
Math.sqrt1_2: Returns the square root of 0.5.
Math.sqrt2: Returns the square root of 2. (The numeric value behind the SQR is specific and cannot be changed)
The object method for math:
ABS (number): Calculates the absolute value of the specified parameter.
ACOs (number): Returns the inverse cosine value of the specified parameter.
ASIN (NUMBER): Returns the inverse string value of the specified parameter.
Atan (number): Returns the tangent value of the specified parameter.
Atan2 (X,y): Returns a Radian value based on the given coordinates.
Floor (x): Rounding down, contrary to the Ceil method
Ceil (number): Returns the smallest integer greater than or equal to the specified parameter. is for integer decimals, rounding up, and rounding down for negative numbers.
cos (x): Returns the cosine of the specified parameter.
Exp: an exponential function with an e as the base.
Log (x): The logarithm of the X natural number with the base of E.
Max (X,y): Returns the maximum value between the two.
Min (x,y): Returns the minimum value for both.
Pow (x,y): A power operation that returns the Y-th side of X.
Random (): Returns a random value between 0-1 without parameters. Accuracy will be higher, decimal 16 digits, so it is best to use ceil or floor to take the whole.
Sin (x): Returns the sine value.
Tan (x): Returns the sine value.
sqrt (x): Returns the open square value.




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.