Example usage for java.math BigInteger andNot

List of usage examples for java.math BigInteger andNot

Introduction

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

Prototype

public BigInteger andNot(BigInteger val) 

Source Link

Document

Returns a BigInteger whose value is (this & ~val) .

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.andNot(bi);
}

From source file:Main.java

public static void main(String[] args) {

    // assign values to bi1, bi2
    BigInteger bi1 = new BigInteger("6"); // 110
    BigInteger bi2 = new BigInteger("3"); // 011

    // perform andNot operation on bi1 using bi2
    BigInteger bi3 = bi1.andNot(bi2);

    System.out.println(bi3);// ww  w  .  jav a  2s. c om
}