Using the Math Object : Math : Development : JavaScript DHTML examples (example source code) Organized by topic

JavaScript DHTML
C++
JavaScript DHTML Home »  Development   » [  Math  ]   
 



Using the Math Object

Please note that some example is only working under IE or Firefox.


/*
Mastering JavaScript, Premium Edition
by James Jaworski 

ISBN:078212819X
Publisher Sybex CopyRight 2001
*/
<HTML>
<HEAD>
<TITLE>Using the Math Object</TITLE>
</HEAD>
<BODY>
<H1>Using the Math Object</H1>
<SCRIPT LANGUAGE="JavaScript"><!--
document.write(Math.PI+"<BR>")
document.write(Math.E+"<BR>")
document.write(Math.ceil(1.234)+"<BR>")
document.write(Math.random()+"<BR>")
document.write(Math.sin(Math.PI/2)+"<BR>")
document.write(Math.min(100,1000)+"<BR>")
// --></SCRIPT>
</BODY>
</HTML>

           
       
Related examples in the same category
1.  Demo all math methods
2.   Counting Rabbits (Calculating the Fibonacci Series Using a Recursive Function)
3.  Math Round: round a number to the nearest whole number
4.  Max number: get max number from two inputs
5.  Min number: get the min number from two inputs
6.  Using the const Keyword








Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.