package com.book.lite;import java.util.regex.Matcher;/*** @author zhangyu* @date 2021年08月19日 11:34 下午* 1.绝对值*/
public class MathDemo {public static void main(String[] args) {System.out.println(methon_1());System.out.println(methon_2());System.out.println(methon_3());System.out.println(methon_4());System.out.println(methon_5());System.out.println(methon_6());}/**** @author zhangyu* @date 2021/8/19 11:39 下午* @return int* 绝对值*/public static int methon_1(){int x = Math.abs(-10);return x;}/**** @author zhangyu* @date 2021/8/19 11:40 下午* @return double* 返回大于或等于该数最小整数*/public static double methon_2(){double d = Math.ceil(43.23);return d;}/**** @author zhangyu* @date 2021/8/19 11:42 下午* @return double* 返回小于或等于该数最小整数*/public static double methon_3(){double d = Math.floor(43.23);return d;}/**** @author zhangyu* @date 2021/8/19 11:53 下午* @return double* 幂运算*/public static double methon_4(){double d = Math.pow(-2,6);return d;}/**** @author zhangyu* @date 2021/8/19 11:54 下午* @return double* 四舍五入*/public static double methon_5(){double d = Math.round(3.45);return d;}public static double methon_6(){double d = Math.sqrt(2);return d;}
}