java Math.round()
2012-11-05 20:43
579 查看
java
Math.round()
?public class Main { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int a=Math.round(11.5f); System.out.println(a); long b=Math.round(-11.5); System.out.println(b); } } /* 12 -11 */
public class MthRound { public static void main(String[] args) throws Exception { //int i=Math.round(11.5); System.out.println(Math.round(11.5)); //int j=Math.round(-11.5); System.out.println(Math.round(-11.5)); System.out.println(Math.round(-11.4)); System.out.println(Math.round(-11.6)); } } /* 12 -11 -11 -12 */
相关文章推荐
- Java Math的 floor,round和ceil
- [转]Java Math的 floor,round和ceil的总结
- 马士兵Java课堂笔记-4-Math.round()函数-强制转换中可以实现四舍五入
- java Math.round()
- Java Math.round()函数小结
- (Java)Math里面的ceil.floor和round的方法区别;
- java Math.round()
- java Math.round()
- Java:Math.round
- Java Math floor round ceil 函数
- (转)Math.Round() -- c# 与 java的区别
- 关于 java 中负数四舍五入的问题——Math.round()
- java Math.round() Java中的四舍五入函数
- java Math.round()
- Java Math.round()函数小结
- java Math.round()
- 关于java中的Math.round、floor、ceil方法区别
- Java Math的 floor,round和ceil的总结
- String compareTo 和 Java.Math.round()运算规则
- 【JAVA】Math.Round()函数常见问题“四舍5入”