KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > java > math > BigInteger

java.math
Class BigInteger

java.lang.Object
  extended by java.lang.Number
      extended by java.math.BigInteger
All Implemented Interfaces:
Serializable, Comparable<BigInteger>
See Also:
Top Examples, Source Code, BigDecimal

public BigInteger abs()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1867]For converting numeric value to its absolute value
By Anonymous on 2007/02/13 06:48:52  Rate
class Absval 
  {  
   public static void main ( String  [  ]  args )  
    {  
     String str="-34.123"; 
     Float Fltabsval= new Float ( str ) ; 
      System.out.println ( Math.abs ( Fltabsval.floatValue (  )  )  ) ; 
    }  
  } ;


public BigInteger add(BigInteger val)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger and(BigInteger val)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger andNot(BigInteger val)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger(byte[] val)
See Also:
NumberFormatException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger(int signum,
                  byte[] magnitude)
See Also:
NumberFormatException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger(int bitLength,
                  int certainty,
                  Random rnd)
See Also:
ArithmeticException, probablePrime
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger(int numBits,
                  Random rnd)
See Also:
IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger(String val)
See Also:
Character.digit(char, int), NumberFormatException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger(String val,
                  int radix)
See Also:
Character.digit(char, int), Character.MAX_RADIX, Character.MIN_RADIX, NumberFormatException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int bitCount()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int bitLength()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger clearBit(int n)
See Also:
ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int compareTo(Object o)
See Also:
Comparable, compareTo(java.math.BigInteger), ClassCastException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int compareTo(BigInteger val)
See Also:
Comparable, compareTo
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger divide(BigInteger val)
See Also:
ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger[] divideAndRemainder(BigInteger val)
See Also:
ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public double doubleValue()
See Also:
Number, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean equals(Object x)
See Also:
Hashtable, Object.hashCode()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger flipBit(int n)
See Also:
ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public float floatValue()
See Also:
Number, Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger gcd(BigInteger val)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getLowestSetBit()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int hashCode()
See Also:
Hashtable, Object.equals(java.lang.Object)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int intValue()
See Also:
Number
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean isProbablePrime(int certainty)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public long longValue()
See Also:
Number
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger max(BigInteger val)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger min(BigInteger val)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger mod(BigInteger m)
See Also:
remainder(java.math.BigInteger), ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger modInverse(BigInteger m)
See Also:
ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger modPow(BigInteger exponent,
                         BigInteger m)
See Also:
modInverse(java.math.BigInteger), ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger multiply(BigInteger val)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger negate()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger nextProbablePrime()
See Also:
ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger not()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final BigInteger ONE
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger or(BigInteger val)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger pow(int exponent)
See Also:
ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1225]Can I get a BigInteger.pow(BigInteger)?
By Dan nqly { at } hotmail { dot } com on 2004/12/23 19:30:42  Rate
Dear Sir/Madam: 
  
  
 Could you please let me know how I get a BigInteger.pow ( BigInteger ) like in BigInteger.modPow ( BigInteger, BigInteger ) instead of BigInteger.pow ( int )  because by narrowing the bigInteger to an integer only lower 32 bits can be obtained, which loses a lot of information. 
  
  
 Thank you ever so much for your gracefull assistance.  
 Wish you merry Christmas and happy New Year! 
  
  
 Sincerely Yours, 
 Dan


[1979]
By Anonymous on 2008/09/03 06:34:40  Rate
you can use the modpow, by using a value of either 0 or 1 for either mod or pow we can keep the biginteger

public static BigInteger probablePrime(int bitLength,
                                       Random rnd)
See Also:
ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger remainder(BigInteger val)
See Also:
ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger setBit(int n)
See Also:
ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger shiftLeft(int n)
See Also:
shiftRight(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger shiftRight(int n)
See Also:
shiftLeft(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int signum()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger subtract(BigInteger val)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final BigInteger TEN
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean testBit(int n)
See Also:
ArithmeticException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public byte[] toByteArray()
See Also:
BigInteger(byte[])
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[30]Convert BigInteger to ByteArray
By Anonymous on 2002/09/18 15:07:00  Rate
BigInteger c ( "300" ) ; 
 byte [  ]  b = c.toByteArray (  ) ; 
 


[166]_
By Anonymous on 2003/10/15 06:31:09  Rate
More accurate: 
  
  
 BigInteger c = new BigInteger ( "300" ) ; 
 byte [  ]  b = c.toByteArray (  ) ; 
 


public String toString()
See Also:
BigInteger(java.lang.String), Character.forDigit(int, int), Object
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String toString(int radix)
See Also:
BigInteger(java.lang.String, int), Character.forDigit(int, int), Integer.toString(int, int), Character.MAX_RADIX, Character.MIN_RADIX
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static BigInteger valueOf(long val)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BigInteger xor(BigInteger val)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final BigInteger ZERO
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags