js Math
来源:互联网 发布:js查找节点的三种方法 编辑:程序博客网 时间:2024/05/16 09:27
<script type="text/javascript">
var v=10.4;
//向上舍入
document.write("ceil:"+Math.ceil(v));
document.write("<hr/>");
var v1=10.8
//向下舍入
document.write("floor"+Math.floor(v1));
document.write("<hr/>");
//四舍五入
document.write("round"+Math.round(v));
document.write("<hr/>");
document.write("round"+Math.round(v1));
//random()得到随机数
document.write("<hr/>");
document.write(Math.random());
//得到0-9之间的随机数
document.write("<hr/>");
document.write(Math.floor(Math.random()*10));
</script>
0 0
- JS Math
- js math
- js Math
- <Js>Math
- JS:Math.random(),Math.ceil(),Math.floor()与Math.round()
- js MAth列表
- JS中 Math.ceil
- js Math的使用
- js Math.random()
- JS中的Math对象
- js Math对象
- js的Math函数
- JS Math函数
- JS中 Math方法
- js Math 对象方法
- JS之Math对象
- js Math工具类
- JS函数(Math)
- 在Windows 8生成和运行Hadoop
- Object-C学习笔记之基础知识一
- 数据编码与精度问题(float)
- Android 简单计算器的实现
- 自定义对话框
- js Math
- 2015 上海网赛 HDU5469 树分治
- 从一道百度面试题到分析输入url到页面返回的过程(或者查询返回过程)
- 电脑突然很卡?!
- js.Date
- js.String
- HDOJ 1902 The Dragon of Loowater【贪心】
- fmdb使用心得(fmdatabase execute update error withargumentsinarray)
- PHP中heredoc的用法(注意事项!)