js中常用的数学函数

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>数学函数</title>
<script type="text/javascript">
var num=Math.ceil(5.2);
var num1=Math.floor(5.9);
var num2=Math.round(5.4);
var num3=Math.floor((Math.random()*10)+2);
alert(num3);

</script>
</head>

<body>
</body>
</html>

posted @ 2009-10-27 14:24  坐看风起  阅读(352)  评论(0编辑  收藏  举报