Math functions in javascript

1,218 views 10 slides Nov 16, 2013
Slide 1
Slide 1 of 10
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10

About This Presentation

Math functions in javascript


Slide Content

MATH FUNCTION IN JAVASCRIPT Fasalul habeeb [email protected] www.facebook.com/Fasalul habeeb twitter.com/username in.linkedin.com/in/ profilename 9544962714 Typing Speed:18

Math Object The Math object allows you to perform mathematical tasks. The Math object includes several mathematical constants and methods. Syntax for using properties/methods of Math: var x= Math.PI ; var y= Math.sqrt (16);

Properties E Euler's constant and the base of natural logarithms, approximately 2.718. LN2 Natural logarithm of 2, approximately 0.693. PI Ratio of the circumference of a circle to its diameter, approximately 3.14159. SQRT2 Square root of 2, approximately 1.414.

The following example uses the round() method of the Math object to round a number to the nearest integer: document.write ( Math.round (4.7)); The code above will result in the following output: 5

Example Return the value of the number 4 to be the power of 3 (4*4*4): Math.pow(4,3); The result will be: 64

Example Round a number downward to its nearest integer: Math.floor (1.6); The output of the code above will be: 1

THE END

If this presentation helped you, please visit our page  facebook.com/ baabtra  and like it. Thanks in advance .    www.baabtra.com  |  www.massbaab.com  | www.baabte.com

Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam , Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam , Kerala, India. Email: [email protected]