/*
public static int min(int a,int b) 求两个数的最小值
public static int max(int a,int b) 求两个数的最大值
public static long round(double a) 四舍五入
public static double ceil(double a) 向上取整
public static double floor(double a) 向下取整
*/
public class MyMath {
public static void main(String[] args) {
int a = 50;
int b = 60;
int min = Math.min(a,b);
int max = Math.max(a,b);
long i = Math.round(45.6);
double x = Math.ceil(90.1);
double y = Math.floor(90.1);
System.out.println(min); //50
System.out.println(max); //60
System.out.println(i); //46
System.out.println(x); //91.0
System.out.println(y); //90.0
}
}
|
|