Java BigInteger pow() methodThe pow() method of Java BigInteger class is used to calculate the power of BigInteger value. This method returns a BigInteger whose value is (thisexponent ). Syntax:Parameter:exponent- exponent to which this BigInteger is to be raised. Returns:This method returns (thisexponent ). Exception:ArithmeticException- exponent is negative. Note: An exponent should be an integer rather than a BigInteger.Example 1Test it NowOutput: 13^2 is 169 Example 2Test it NowOutput: 100^3 is 1000000 Example 3Test it NowOutput: java.lang.ArithmeticException: Negative exponent Next TopicJava BigInteger |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India