您的位置:首页 > 编程语言 > Java开发

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

 }

}

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: