1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package _22javacoreclass;

import java.security.SecureRandom;

public class Main4 {
public static void main(String[] args){
// 绝对值
System.out.println(Math.abs(-100));
System.out.println(Math.abs(-7.8));
//最大值最小值
System.out.println(Math.max(100,99));
System.out.println(Math.min(1.2,2.3));
//计算xy次方
System.out.println(Math.pow(2, 10));
//计算√x
System.out.println(Math.sqrt(2));
//计算ex次方
System.out.println(Math.exp(2));
//计算以e为底的对数
System.out.println(Math.log(4));
//计算以10为底的对数
System.out.println(Math.log10(100));
//三角函数
System.out.println(Math.sin(3.14));
System.out.println(Math.cos(3.14));
System.out.println(Math.tan(3.14));
System.out.println(Math.asin(1.0));
System.out.println(Math.acos(1.0));
//数学常量
System.out.println(Math.PI);
System.out.println(Math.E);
System.out.println(Math.sin(Math.PI / 6));
//随机数
System.out.println(Math.random());
System.out.println(Math.asin(1.0));
System.out.println(Math.asin(1.0));
System.out.println(Math.asin(1.0));
//真随机数
SecureRandom sr = new SecureRandom();
System.out.println(sr.nextInt(100));

}
}