On the properties and methods of the JS built-in object math (recommended) _ Basics

Source: Internet
Author: User
Tags natural logarithm square root value of pi

Property:

The function reference of the object established by constructor

Prototype attributes and methods that can be added to an object

E Euler constant, base of natural logarithm (approximately equal to 2.718)

The natural logarithm of the LN2 2 (approximately equal to 0.693)

The natural logarithm of the LN10 10 (approximately equal to 2.302)

LOG2E the logarithm of the 2-base E. (approximately equal to 1.442)

LOG10E the logarithm of the 10-base E (about 0.434)

Value of Pi∏ (approximately equal to 3.14159)

Sqrt1_2 1/2 (0.5) square root (i.e. l divided by 2 square root, approximately equal to o.707)

SQRT2 2 square root (approximately equal to 1.414)

Method:

ABS (x) returns the absolute value of a number

ACOs (x) returns the inverse cosine of a number

ASIN (x) returns the inverse chord value of a number

Atan (x) returns the tangent value at-PI/2 and PI/2

ATAN2 (y,x) return (x,y) at the angle between-pi and PI

Ceil (x) returns the largest integer after X rounding

COS (x) returns the cosine of a number

EXP (x) returns E^X value

Floor (x) returns the smallest integer after x rounding

Log (x) returns the natural logarithm of the base E

Max (X,y) returns the larger number between x and Y

MIN (x,y) returns the smaller number between x and Y

POW (x,y) returns the value of Y^x

Random () returns a random function that is between 0 and 1

Round (x) rounded after rounding

Sin (x) returns the sine value of a number

SQRT (x) returns the square root of a number

Tan (x) returns the tangent of an angle

Tosource () Displays the source code of the object

ValueOf () returns the original value of the mathematical object

The above is small series for everyone to talk about JS built-in object math properties and methods (recommended) All the content, I hope to help you, a lot of support cloud Habitat Community ~

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.