Description Of BigInteger: setBit(int n)
The java.math.BigInteger.setBit(int n) returns a BigInteger whose value is equivalent to this BigInteger with the designated bit set. (Computes (this | (1<<n)))BigInteger.setBit(int n) method returns this | (1<<n)
Code Example Java BigInteger
import java.math.BigInteger; public class BigIntegerExam { public static void main(String[] args) { BigInteger bi1 = new BigInteger("4"); BigInteger bi2 = bi1.setBit(3); System.out.println(bi2); // output 12 } }
ไม่มีความคิดเห็น :
แสดงความคิดเห็น