Find exponential using pow method of Math class in Java

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

How to find exponential value in Java?

Use the pow static method of the Java Math class to find an exponential number.

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

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

Output

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

BaseExponentResult
Any0 or -01.0
Any1.0Same as base value
AnyNaNNaN
NaNNon ZeroNaN
abs(base) > 1Double.POSITIVE_INFINITYDouble.POSITIVE_INFINITY
abs(base) < 1Double.NEGATIVE_INFINITYDouble.POSITIVE_INFINITY
abs(base) > 1Double.NEGATIVE_INFINITY0
abs(base) < 1Double.POSITIVE_INFINITY0
1Double.POSITIVE_INFINITY or

Double.NEGATIVE_INFINITY

NaN
0>00
Double.POSITIVE_INFINITY< 00
0< 0Double.POSITIVE_INFINITY
Double.POSITIVE_INFINITY> 0Double.POSITIVE_INFINITY
0> 0 and != finite odd integer0
Double.NEGATIVE_INFINITY< 0 and != finite odd integer0
-0positive finite odd integer-0
Double.NEGATIVE_INFINITYnegative finite odd integer-0
-0< 0 and != finite odd integerDouble.POSITIVE_INFINITY
Double.NEGATIVE_INFINITY> 0 and != finite odd integerDouble.POSITIVE_INFINITY
-0negative finite odd integerDouble.NEGATIVE_INFINITY
Double.NEGATIVE_INFINITYpositive finite odd integerDouble.NEGATIVE_INFINITY

This example is a part of the Java Math class tutorial with examples.

Please let me know your views in the comments section below.

About the author

RahimV

RahimV

My name is RahimV and I have over 16 years of experience in designing and developing Java applications. Over the years I have worked with many fortune 500 companies as an eCommerce Architect. My goal is to provide high quality but simple to understand Java tutorials and examples for free. If you like my website, follow me on Facebook and Twitter.

Add Comment

Your email address will not be published. Required fields are marked *