<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>JS中的Math对象</title> </head> <body> <script type="text/javascript"> /* 演示JS中的Math对象的常用方法 */ document.write(Math.abs(-9) + "<br />"); document.write(Math.ceil(7.8)+ "<br />"); document.write(Math.floor(7.8)+ "<br />"); document.write(Math.random()+ "<br />"); document.write(Math.round(7.4)+ "<br />"); document.write(Math.round(7.5)+ "<br />"); </script> </body> </html>