当前位置:编程学习 > JAVA >>

Java math.round

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));
 }

}
 

补充:软件开发 , Java ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,