BigInteger Class In Java

0
208
Spread the love
  • 12
  • 11
  • 23
  • 12
  •  
  •  
  •  
  •  
  •  
  •  
    58
    Shares

BigInteger Class In Java
BigInteger Class In Java
BigInteger Class In Java

BigInteger Class In Java:

BigInteger supports arbitrary precision integers. This means that we can accurately represent integral values of any size without losing any information during operation. BigInteger is not limited to 64 bits (like long). This class defines some methods that do the same thing as normal arithmetic operator or bit manipulation operators does.

The structure of the BigInteger class defined as:


public class java.math.BigInteger extends
java.lang.Number {
//Constructors
public BigInteger(byte[] val) throws NumberFormatException;
public BigInteger(int signum, byte[] magnitude) throws NumberFormatException;
public BigInteger(String val, int radix) throws NumberFormatException;
public BigInteger(String val) throws NumberFormatException;
public BigInteger(int numBits, Random rndSrc) throws IllegalArgumentException;
public BigInteger(int bitLength, int certainty, Random rnd);
//Methods
public static BigInteger valueOf(long val);
public BigInteger abs();
public BigInteger add(BigInteger val) throws ArithmeticException;
public BigInteger and(BigInteger val);
public BigInteger andNot(BigInteger val);
public int bitCount();
public int bitLength();
public BigInteger clearBit(int n) throws ArithmeticException;
public int compareTo(BigInteger val);
public BigInteger divide(BigInteger val) throws ArithmeticException;
public BigInteger[] divideAndRemainder(BigInteger val) throws ArithmeticException;
public double doubleValue();
public boolean equals(Object x);
public BigInteger flipBit(int n) throws ArithmeticException;
public float floatValue();
public BigInteger gcd(BigInteger val);
public int getLowestSetBit();
public int hashCode();
public int intValue();
public boolean isProbablePrime(int certainty);
public long longValue();
public BigInteger max(BigInteger val);
public BigInteger min(BigInteger val);
public BigInteger mod(BigInteger m);
public BigInteger modInverse(BigInteger m) throws ArithmeticException;
public BigInteger modPow(BigInteger exponent, BigInteger m);
public BigInteger multiply(BigInteger val);
public BigInteger negate();
public BigInteger not();
public BigInteger or(BigInteger val);
public BigInteger pow(int exponent) throws ArithmeticException;
public BigInteger remainder(BigInteger val) throws ArithmeticException;
public BigInteger setBit(int n) throws ArithmeticException;
public BigInteger shiftLeft(int n);
public BigInteger shiftRight(int n);
public int signum();
public BigInteger subtract(BigInteger val);
public boolean testBit(int n) throws ArithmeticException;
public byte[] toByteArray();
public String toString(int radix);
public String toString();
public BigInteger xor(BigInteger val);
}
Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 12
  • 11
  • 23
  • 12
  •  
  •  
  •  
  •  
  •  
  •  
    58
    Shares

LEAVE A REPLY

Please enter your comment!
Please enter your name here