Example usage for java.math BigInteger BigInteger

List of usage examples for java.math BigInteger BigInteger

Introduction

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

Prototype

private BigInteger(long val) 

Source Link

Document

Constructs a BigInteger with the specified value, which may not be zero.

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);/*  w  w w .  j  av a  2 s . com*/
}

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.not();/*  w ww .j  a v a2  s  .  c o m*/
}

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.shiftLeft(3);//  w  w w  .  j av a2 s  . c  o  m

}

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);
    boolean b = bi.testBit(3);
    b = bi.testBit(16);/*from  w  w w.  ja  va2s.c o m*/
}

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.flipBit(3);//from  w w w.jav  a2  s .com

}

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 w  w w .  j  av  a  2 s .  c  o m

}

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.setBit(3);/* w w w. j  av  a  2s  .  c  o m*/

}

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.xor(bi);//from w w w.  j ava2  s.  co m
}

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.shiftRight(1);//from  ww w  . j  a  v  a 2s. com

}

From source file:Main.java

public static void main(String[] args) {

    int exponent = 2;

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

    // perform pow operation on bi1 using exponent
    BigInteger bi2 = bi1.pow(exponent);

    System.out.println(bi2);//from   w w  w  .j  av a2  s. co  m
}