Overview of using the Math object method in JavaScript

Source: Internet
Author: User
Tags natural logarithm rounds square root

The Math object method in  javascript is rounded up, with a decimal number plus 1 for the integer part, rounding, down, and so on, and so on, here's a detailed description of

1. Discard the fractional part and keep the integer part parseint (5/2)   2. Rounding up, there are decimals on the integer part plus 1   math.ceil (5/2)   3, rounded.   Math.Round (5/2)   4, rounding up   Math.floor (5/2)   Math object Ff:firefox, N:netscape, Ie:internet Explo RER   method describes the absolute value of the FF N ie  ABS (x) return number 1 2 3  acos (x) returns the inverse cosine of the number 1 2 3  ASIN (x) The inverse of the number of strings 1 2 3  atan (x Returns the inverse tangent of x to the value between-PI/2 and PI/2 radians 1 2 3  atan2 (y,x) returns the angle from the x-axis to point (x,y) (between-PI/2 and PI/2 radians) 1 2 3  ceil (x) Rounds a number to the top. 1 2 3  cos (x) returns the cosine of a number of 1 2 3  exp (x) to return the exponent of E. 1 2 3  Floor (x) rounds down a number. 1 2 3  log (x) returns the natural logarithm of the number (base e) 1 2 3  max (x,y) returns the highest value in X and y 1 2 3  min (x,y) returns the lowest value in X and y 1 2 3  pow (x , y) returns the y power of x 1 2 3  random () returns 0 ~ 1 of the random number 1 2 3  round (x) rounded a number to the nearest integer 1 2 3  sin (x) returns the sine of the number 1 2 3& nbsp SQRT (x) returns the square root of the number 1 2 3  tan (x) returns a tangent of a corner of 1 2 3  Tosource () represents the source code of the object 1 4-  valueof () returns the original value of a 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.