Mathematical operations in JavaScript

Source: Internet
Author: User
Tags natural logarithm square root

1     varA1 = Math.pow (2,3);//2 of 3 power2     varA2 = Math.Round (. 6);//Rounding3     varA3 = Math.Round (0.6);//rounding, self-testing complete decimal rounding4     vara4 = Math.ceil (. 6);//To seek the whole up5     varA5 = math.floor (. 6);//The country to seek the whole6     varA6 = Math.Abs (-5);//Seek absolute value7     varA7 = Math.max (3,5,8);//returns the maximum value8     varA8 = Math.min (3,5,8);//returns the minimum value9     varA9 = Math.random ();//generates a value greater than or equal to 0 less than 1. Random number of 0Ten     varA10 = Math.PI;//Pi One     varA11 = MATH.E;//Base of natural logarithm A     varA12 = MATH.SQRT (3);//square root of 3 -     varA13 = Math.pow (3,1/3); 3 of Cube root -     varA14 = Math.sin (0);//trigonometric Functions, Math.cos,math.atan, etc. the     varA15 = Math.log (10);//Natural logarithm of 10 -     varA16 = Math.log (/MATH.LN10); Logarithm of 100 at base 10 -     varA17 = Math.log (/MATH.LN2); Logarithm with base 512 of 2 -     varA18 = Math.exp (3);//three power of e

Mathematical operations in JavaScript

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.