-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMathClass.java
More file actions
58 lines (40 loc) · 1.86 KB
/
Copy pathMathClass.java
File metadata and controls
58 lines (40 loc) · 1.86 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
public class MathClass {
public static void main(String[] args) {
// System.out.print("Absolute :");
// System.out.println(Math.abs(-123));
// System.out.print("Absolute :");
// System.out.println(StrictMath.abs(-123));
// System.out.print("cube Root :");
// System.out.println(Math.cbrt(27));
// System.out.print("Excat Decrement :");
// System.out.println(Math.decrementExact(7));
// System.out.print("Exponent value in floating point reprersentation :");
// System.out.println(Math.getExponent(12.345));
// System.out.print("Round Division :");
// System.out.println(Math.floorDiv(50,9));
// System.out.print("e poewer x:");
// System.out.println(Math.exp(1));
// System.out.print("e power x:");
// System.out.println(StrictMath.exp(1));
// System.out.print("log base 10 :");
// System.out.println(Math.log10(100));
// System.out.print("maximum :");
// System.out.println(Math.max(10,9));
// System.out.print("minimum :");
// System.out.println(Math.min(10,9));
// System.out.println("tan :");
// System.out.println(Math.tan(45*Math.PI/180));
// System.out.print("convert to radian :");
// System.out.println(Math.toRadians(45));
// System.out.print("convert to degree :");
// System.out.println(Math.toDegrees(Math.atan(0.7853981633974483)));
System.out.print("Random number :");
System.out.println(Math.random()*1000);
System.out.print("Power :");
System.out.println(Math.pow(2, 3));
System.out.print("Exact product :");
System.out.println(Math.multiplyExact(100,200));
System.out.print("Next float value :");
System.out.println(Math.nextAfter(12.5, 13));
}
}