## Math类

Math类是一个很有用的数学帮助类，使用也非常简单，这个类比较特殊，首先他和String类一样都是用final修饰，所以不能有子类，还有就是它的构造方法是私有的，也就是我们不能通过new的方法在其它类中构造Math对象，那么我们怎样调用它的方法，原来它的所有的方法都是静态方法，也就是可以直接使用类名就可以访问方法了。

static double abs(double a)

static float abs(float a)

static int abs(int a)

static long abs(long a)

static double acos(double a)

static double asin(double a)

static double atan(double a)

static double atan2(double y, double x)

static double cbrt(double a)

static double ceil(double a)

static double cos(double a)

static double cosh(double x)

static double exp(double a)

static double expm1(double x)

static double floor(double a)

static double hypot(double x, double y)

static double IEEEremainder(double f1, double f2)

static double log(double a)

static double log10(double a)

static double log1p(double x)

static double max(double a, double b)

static float max(float a, float b)

static int max(int a, int b)

static long max(long a, long b)

static double min(double a, double b)

static float min(float a, float b)

static int min(int a, int b)

static long min(long a, long b)

static double pow(double a, double b)

static double random()

static double rint(double a)

static long round(double a)

static int round(float a)

static double signum(double d)

static float signum(float f)

static double sin(double a)

static double sinh(double x)

static double sqrt(double a)

static double tan(double a)

static double tanh(double x)

static double ulp(double d)

static float ulp(float f)

```       System.out.println(Math.PI);

System.out.println(Math.abs(-1));

System.out.println(Math.floor(100.99));

System.out.println(Math.ceil(100.00001));

System.out.println(Math.round(20.4));

System.out.println(Math.max(99, 98));

System.out.println(Math.pow(2, 10));

System.out.println((int)(Math.random()*10));//随机的 1-10

System.out.println(Math.sqrt(9));

System.out.println((-5-Math.sqrt(Math.pow(5, 2)-4*2*2))/2);
System.out.println("x=");```