码迷,mamicode.com
首页 > Web开发 > 详细

js math对象

时间:2015-05-20 07:04:05      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:

Math对象
执行常见的算数任务
常用方法
round()四舍五入
random()返回0~1之间的随机数
max():返回最高值
min():返回中的最低值
abs():返回绝对值
-->

<script>
// document.write(Math.round(2.3));

document.write(Math.random()*10);
document.write(parseInt(Math.random()*10));//int 类型
document.write(Math.max("23","43","53","3"));
document.write(Math.abs("-23"));
</script>

js math对象

标签:

原文地址:http://www.cnblogs.com/xiezefeng/p/4516071.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!