Example usage for java.math BigInteger clearBit

List of usage examples for java.math BigInteger clearBit

Introduction

In this page you can find the example usage for java.math BigInteger clearBit.

Prototype

public BigInteger clearBit(int n) 

Source Link

Document

Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit cleared.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    byte[] bytes = new byte[] { 0x1, 0x00, 0x00 };
    BigInteger bi = new BigInteger(bytes);
    bi = bi.clearBit(3);

}

From source file:Main.java

public static void main(String[] args) {

    // assign value to bi1
    BigInteger bi1 = new BigInteger("7");

    // perform clearbit operation on bi1 with index 2
    BigInteger bi2 = bi1.clearBit(2);

    System.out.println(bi2);//from  w w w.  j a v  a2s  .c om
}