Description Of BigInteger: pow(int exponent)
The java.math.BigInteger.pow(int exponent) returns a BigInteger whose value is (thisexponent). Note that exponent is an integer rather than a BigIntegerBigInteger.or(BigInteger val) method returns thisexponent
Code Example Java BigInteger
import java.math.BigInteger; public class BigIntegerExam { public static void main(String[] args) { BigInteger bi1 = new BigInteger("2"); System.out.println(bi1.pow(2)); // output 4 (2*2) System.out.println(bi1.pow(3)); // output 8 (2*2*2) } }
ไม่มีความคิดเห็น :
แสดงความคิดเห็น