Java Basic Examples

# Find exponential using pow method of Math class in Java

This example shows how to find exponential number using `pow()` method of Java `Math` class.

## How to find exponential value in Java?

Use `pow()` static method of Java Math class to find exponential number in Java.

Where x is the base value and y is the exponent.

This method returns the value of base raised to the power of exponent.

Output

Below given table shows some of the special case base and exponent values and their respective results.

 Base Exponent Result Any 0 or -0 1.0 Any 1.0 Same as base value Any NaN NaN NaN Non Zero NaN abs(base) > 1 Double.POSITIVE_INFINITY Double.POSITIVE_INFINITY abs(base) < 1 Double.NEGATIVE_INFINITY Double.POSITIVE_INFINITY abs(base) > 1 Double.NEGATIVE_INFINITY 0 abs(base) < 1 Double.POSITIVE_INFINITY 0 1 Double.POSITIVE_INFINITY orDouble.NEGATIVE_INFINITY NaN 0 >0 0 Double.POSITIVE_INFINITY < 0 0 0 < 0 Double.POSITIVE_INFINITY Double.POSITIVE_INFINITY > 0 Double.POSITIVE_INFINITY 0 > 0 and != finite odd integer 0 Double.NEGATIVE_INFINITY < 0 and != finite odd integer 0 -0 positive finite odd integer -0 Double.NEGATIVE_INFINITY negative finite odd integer -0 -0 < 0 and != finite odd integer Double.POSITIVE_INFINITY Double.NEGATIVE_INFINITY > 0 and != finite odd integer Double.POSITIVE_INFINITY -0 negative finite odd integer Double.NEGATIVE_INFINITY Double.NEGATIVE_INFINITY positive finite odd integer Double.NEGATIVE_INFINITY

Want to learn quickly?
Try one of the many quizzes. I promise you will not be disappointed.

Tags