轻松搞定Math.ceil,Math.round,Math.floor三者的区别
来源:互联网 发布:卡通设计软件 编辑:程序博客网 时间:2024/06/08 11:11
double a = 0.1; double b = 0.50; double c = 0; double d = 0.4; double e = 0.6; double f = 1.3; double g = 1.6; //Math.ceil 表示的是大于某个小数的最小整数的double值; ceiling最高限度 天花板 double ceil1 = Math.ceil(a); double ceil2 = Math.ceil(b); double ceil3 = Math.ceil(c); double ceil4 = Math.ceil(d); double ceil5 = Math.ceil(e); //Math.round 表示的是四舍五入,且得到long值 long round1 = Math.round(a); long round2 = Math.round(b); long round3 = Math.round(c); long round4 = Math.round(d); long round5 = Math.round(e); //Math.floor 跟Math.ceil相反,表示的是小于某个小数的最大整数值的double类型; floor底板 最底限度 double floor1 = Math.floor(a); double floor2 = Math.floor(b); double floor3 = Math.floor(c); double floor4 = Math.floor(d); double floor5 = Math.floor(e); double floor6 = Math.floor(f); double floor7 = Math.floor(g);
0 0
- 轻松搞定Math.ceil,Math.round,Math.floor三者的区别
- Math.round|Math.floor|Math.ceil区别
- Math.round(),Math.ceil(),Math.floor()的区别
- java 中 Math.round() Math.ceil() Math.floor()区别
- Math.round ceil floor
- Math.ceil()和Math.floor()、Math.round()
- Math.floor,Math.round,Math.ceil
- Math.round, Math.ceil 和 Math.floor
- Math.floor()/Math.ceil()/Math.round()
- Math.ceil、Math.floor、Math.round用法
- Math.ceil() 、Math.floor() 、Math.round() 三个函数的理解
- js中的Math.ceil() 、Math.floor() 、Math.round() 的意思
- javascript中的Math.round()和Math.floor()函数Math.ceil()的区别
- JAVA 中Math.ceil()、Math.floor()和Math.round()的区别
- parseInt()、Math.round()、Math.floor()、Math.ceil()四种取整方法的区别
- Math.floor、round、ceil 取值区别
- JS:Math.random(),Math.ceil(),Math.floor()与Math.round()
- Math.random()、Math.ceil()、Math.floor()、Math.round()
- 正则表达式
- 如何读懂一篇学术论文?
- 定时器quartz的配置与测试
- Android_聊一聊Activity(二)
- wells 效果 (Bootstrap)
- 轻松搞定Math.ceil,Math.round,Math.floor三者的区别
- Android开发中文站 » Android酷炫实用的开源框架(UI框架)
- 位运算符
- hadoop2.6完全分布式环境搭建(下-->配置文件)
- 数据库设计冗余字段
- php将十六进制转义序列转换成字符串
- NPOI 导出Excel
- 如何查看容器的IP地址和网络相关的参数
- Ubuntu14.04 配置theano、keras、tensorflow、tensorlayer