Sunday, August 2, 2020

thumbnail

Java program to demonstrate working of java.lang.Math.pow() method

 // Java program to demonstrate working of java.lang.Math.pow() method  or how to implement power function in java
public class MathPower1 {
public static void main(String[] args) {
double nan = Double.NaN;
double result;
//2^NAN
result = Math.pow(2, nan);
System.out.println(result);
//1245^0
System.out.println(Math.pow(1245, 0));
//5^1
System.out.println(Math.pow(5, 1));
}

}


Java Math code

#Java_Program
#Java_Practice_Program

Subscribe by Email

Follow Updates Articles from This Blog via Email

No Comments

FullStackDeveloper. Powered by Blogger.