JsMath object method_basic knowledge

Source: Internet
Author: User
Tags natural logarithm
The methods of jsMath objects are rounded up, rounded down, rounded down, and so on. Numeric operations are often used. If you need them, refer to section 1. Discard the decimal part and retain the integer part.

ParseInt (5/2)

2. rounded up. If there is a decimal number, add 1 to the integer part.

Math. ceil (5/2)

3. rounding.

Math. round (5/2)

4. Round down

Math. floor (5/2)

Math object Method

FF: Firefox, IE: Internet Explorer

Method Description FF IE
Abs (x) Returns the absolute value of a number. 1 3
Acos (x) Returns the arc cosine of a number. 1 3
Asin (x) Returns the arc sine of the number. 1 3
Atan (x) Returns the arc tangent value of x with a value between-PI/2 and PI/2 radian. 1 3
Atan2 (y, x) Returns the angle from the x-axis to the point (x, y) (between-PI/2 and PI/2 radian ). 1 3
Ceil (x) The logarithm is rounded up. 1 3
Cos (x) Returns the cosine of the number. 1 3
Exp (x) Returns the index of e. 1 3
Floor (x) The logarithm is deprecated. 1 3
Log (x) Returns the natural logarithm of the number (Base e ). 1 3
Max (x, y) Returns the highest value in x and y. 1 3
Min (x, y) Returns the lowest value in x and y. 1 3
Pow (x, y) Returns the Power y of x. 1 3
Random () Returns 0 ~ A random number between 1. 1 3
Round (x) Round the number to the nearest integer. 1 3
Sin (x) Returns the sine of the number. 1 3
Sqrt (x) Returns the square root of a number. 1 3
Tan (x) Returns the tangent of the angle. 1 3
ToSource () Returns the source code of the object. 1 -
ValueOf () Returns the original value of the Math object. 1 4
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.