Forum : What are the Math Constants and Functions used in JavaScript?
Brief description  about Online courses   join in Online courses
View Sheetal  Panday 's Profile

What are the Math Constants and Functions used in JavaScript?

Sir,

Can you please explain the Math Constants and Functions
used in javascript
Asked by Sheetal Panday | Nov 23, 2009 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Sheetal,

The following are few Math Constants and Functions used in JavaScript

1)Math object contains useful constants such as Math.PI, Math.E

2)Math also has a zillion helpful functions.

3)Math.abs(value); //absolute value

4)Math.max(value1, value2); //Used for finding the largest value

5)Math.random() //generate a decimal number between 0 and 1

6)Math.floor(Math.random()*101) //generate a decimal number between 0 and 100
Nov 23, 2009