exponent in java code example
Example 1: java exponent operator
Math.pow(number, exponent)
Example 2: how to use pow function in java
import java.lang.Math;
class Gfg {
public static void main(String args[])
{
double a = 30;
double b = 2;
System.out.println(Math.pow(a, b));
a = 3;
b = 4;
System.out.println(Math.pow(a, b));
a = 2;
b = 6;
System.out.println(Math.pow(a, b));
}
Example 3: raise number to power java
Math.pow(number, power);
Example 4: exponents java
math.pow(number, power);
Example 5: java exponential
(int) Math.pow(first, second));