Math函数
来源:互联网 发布:淘宝换货需要先签收吗 编辑:程序博客网 时间:2024/06/05 01:10
1.Math.floor() 向下取整
举例:
Math.floor(18.6)的结果为18
Math.floor(-1.1)的结果为-2
2.Math.round() 四舍五入
举例:
Math.round(18.5)的结果为19
Math.round(-1.1)的结果为-1
Math.round(-1.5)的结果为-1
Math.round(-1.6)的结果为-2
3.Math.ceil() 向上取整
举例:
Math.ceil(-1.1)的结果为-1
Math.ceil(-1.5)的结果为-1
Math.ceil(0.1)的结果为1
4.Math.rint() 返回double值最接近参数的值,如果同样接近则返回偶数值
举例:
Math.rint(-1.1)的结果为-1.0
Math.rint(-1.5)的结果为-2.0
Math.rint(0.5)的结果为0.0
阅读全文
0 0
- Math 函数
- Math函数
- 函数Math
- math函数
- Math函数
- Math函数
- math.random()、math.floor()、math.round()、math.ceil()函数总结
- math.random()、math.floor()、math.round()、math.ceil()函数
- Math.Round函数说明
- Delphi Math单元函数
- Math函数性能比较
- JAVA 函数 Math API
- Math.Round 四舍五入函数
- javascript Math函数
- 数学函数<math.h>
- Math函数性能比较
- jquery Math函数
- c++math函数
- Flex-缩放自适应布局
- Java web图片上传本地预览,无需后台写接口
- 会自动伸缩的文本输入框HPGrowingTextView
- 洛谷9月月赛--T2[T2]预生成密码
- 学习浅墨opencv入门教程三之综合实例犯错总结
- Math函数
- Struts2+Ajax实现检测用户名是否唯一
- 前端面试拾遗——this、类型检测、es6
- Android开发之线程池使用总结
- android点赞效果--LikeView
- 并发的HashMap为什么会引起死循环
- How to make 9-patch image downloaded from the Network
- Vue-01
- Tomcat在虚拟机下的Linux(ubuntu)上的安装与配置