JavaScript Math Object

Source: Internet
Author: User
Tags natural logarithm square root

Math Object Properties
    • Pi π
    • E-Readme Constants
    • LN2 returns the natural logarithm of 2
    • LN10 returns the natural logarithm of 10
    • LOG2E returns the logarithm of base E with 2
    • LOG10E returns the logarithm of base E with 10
    • SQRT2 returns the square root of 2
    • Sqrt1_2 returns the reciprocal of the square root of 2
Math Object method
    • ABS (x) absolute value
    • Random () Number
    • Rounding on Ceil (x)
    • Round (x) rounding
    • Floor (x) rounding down
    • Max (x, y) returns the maximum value
    • Min (x, y) returns the minimum value
    • Pow (x, y) returns the Y-square of X
    • Log (x) returns the natural logarithm of the number, if required to base 1024 logarithm of 2, you need to use Math.log (1024x768)/Math.log (2)
    • EXP (x) returns the exponent of E
    • sqrt (x) The square root of the number of returns

  

    • Trigonometric function
    • Sin (x)
    • ASIN (x)
    • COS (x)
    • ACOs (x)
    • Tan (x)
    • Atan (x)
    • ATAN2 (y,x) returns the angle from the x-axis to the point (X, y) (between-PI/2 and PI/2 radians)
    • Tosource () returns the source code of the object (not commonly used, not understood)
    • ValueOf () returns the original value of the Math object (not commonly used, can not be understood)

JavaScript Math Object

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.