码迷,mamicode.com
首页 > 其他好文 > 详细

Math

时间:2019-09-01 22:03:14      阅读:80      评论:0      收藏:0      [点我收藏+]

标签:col   static   div   asi   math   ack   大量   ring   math类   

package cn.learn.basic;
/*
  java.util.Math类含有大量的静态方法
  public static double abs(double num)  -求double绝对值
  public static double ceil(double num)  -向上取整
  public static double floor(double num)  -向下取整
  public static long round(double) -四舍五入
 */
public class MathApi {
    public static void main(String[] args) {
        double num=-1.2;
        System.out.println(Math.abs(num)); //1.2
        System.out.println(Math.ceil(num)); //-1.0

    }
}

 

Math

标签:col   static   div   asi   math   ack   大量   ring   math类   

原文地址:https://www.cnblogs.com/huxiaobai/p/11443696.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!