Java math.round()
2012-11-29 11:06
381 查看
public class Testc {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(Math.round(0.5));
System.out.println(Math.round(1.5));
System.out.println(Math.round(2.5));
System.out.println(Math.round(3.5));
System.out.println(Math.round(0.3));
System.out.println(Math.round(0.9));
System.out.println(Math.round(6.5));
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(Math.round(0.5));
System.out.println(Math.round(1.5));
System.out.println(Math.round(2.5));
System.out.println(Math.round(3.5));
System.out.println(Math.round(0.3));
System.out.println(Math.round(0.9));
System.out.println(Math.round(6.5));
}
}
相关文章推荐
- Java Math的 floor,round和ceil
- 马士兵Java课堂笔记-4-Math.round()函数-强制转换中可以实现四舍五入
- java Math.round()
- Java Math.round()函数小结
- java中Math方法的ceil,floor,round方法
- Java Math的 floor,round和ceil的总结
- (Java)Math里面的ceil.floor和round的方法区别;
- 关于 java 中负数四舍五入的问题——Math.round()
- java Math.round() Java中的四舍五入函数
- Java Math的 floor,round和ceil
- Java入门学习-使用Math,实现lg、平方、开方、round、floor、ceil的算法。
- Java Math的 floor,round和ceil的总结
- Java Math.round()函数小结
- Java进阶--从源码理解Math.ceil()、Math.floor()、Math.round()
- Java:Math.round
- Java Math的 floor,round和ceil的总结
- 【JAVA】Math.Round()函数常见问题“四舍5入”
- Java Math.round方法
- Java Math的floor、ceil、rint及round方法
- [java] Math.round()