首页 > Web开发 > 详细

js math对象

时间:2015-05-20 07:02:24      阅读:156      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!