t;script language="JavaScript">
1 var num=16;
document.write("<h3>The square root of " +num+ " is ");
2 document.write(Math.sqrt(num),".<br>");
document.write("PI is ");
3 document.write(Math.PI);
document.write(".<br>"+num+" raised to the 3rd power is " );
4 document.write(Math.pow(num,3));
document.write(".</h3></font>");
</script>
</body></html>
Rounding Up and Rounding Down
There are three Math methods available for rounding numbers up or down. They are the ceil(), floor(), and round() methods (see Table 9.7 for examples). The dif |