-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMath Class .java
More file actions
41 lines (41 loc) · 2.71 KB
/
Math Class .java
File metadata and controls
41 lines (41 loc) · 2.71 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
public class Java {
public static void main(String Args[]) {
double no1=-84;
int no2=-84;
float no3=-84;
long no4=-84;
System.out.println("Double Absolute Value is "+Math.abs(no1));
System.out.println("Integer Absolute Value is "+Math.abs(no2));
System.out.println("Float Absolute Value is "+Math.abs(no3));
System.out.println("Long Absolute Value is "+Math.abs(no4));
System.out.println("Addition of Exact two Integers is "+Math.addExact(no2,no2));
System.out.println("Addition of Exact two Long Numbers is "+Math.addExact(no4,no4));
System.out.println("Arc-Sin of -84(Double) is "+Math.asin(no1));
System.out.println("Arc-Cos of -84(Double) is "+Math.acos(no1));
System.out.println("Arc-Tan of -84(Double) is "+Math.atan(no1));
System.out.println("Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta) is "+Math.atan2(no1,no1));
System.out.println("Cube-Root of -84(Double) is "+Math.cbrt(no1));
System.out.println("Square-Root of -84(Double) is "+Math.sqrt(no1));
System.out.println("Cos of -84(Double) is "+Math.cos(no1));
System.out.println("ExactDecrement of 1 from integer -84 is "+Math.decrementExact(no2));
System.out.println("ExactDecrement of 1 from long -84 is "+Math.decrementExact(no4));
System.out.println("ExactIncrement of 1 from integer -84 is "+Math.incrementExact(no2));
System.out.println("ExactIncrement of 1 from long -84 is "+Math.incrementExact(no4));
System.out.println("Exponential Number of -84(Double) is "+Math.exp(no1));
System.out.println("Pythagorus Theorem / Hypotenous of two -84(Double) is "+Math.hypot(no1,no1));
System.out.println("Natural Log of -84(Double) is "+Math.log(no1));
System.out.println("Log-10 of -84(Double) is "+Math.log10(no1));
System.out.println("Max of two -84(Double) is "+Math.max(no1,no1));
System.out.println("Min of two -84(Double) is "+Math.min(no1,no1));
System.out.println("Max of two -84(Integer) is "+Math.max(no2,no2));
System.out.println("Min of two -84(Integer) is "+Math.max(no2,no2));
System.out.println("Max of two -84(Float) is "+Math.max(no3,no3));
System.out.println("Min of two -84(Float) is "+Math.min(no3,no3));
System.out.println("Max of two -84(Long) is "+Math.max(no4,no4));
System.out.println("Min of two -84(Long) is "+Math.max(no4,no4));
System.out.println("if not exact in long range returns exception else Multiplication(*) of two -84(Long) is "+Math.multiplyExact(no4,no4));
System.out.println("if not exact in integer range returns exception else Multiplication(*) of two -84(Integer) is "+Math.multiplyExact(no2,no2));
System.out.println("Power of two -84(Double) in form (base,exponent) is "+Math.pow(no1,no1));
System.out.println("Random number b/w 0.0-0.99 is "+Math.random());
}
}