Clone wiki

TForge / Classes / BigInteger / BigInteger

type BigInteger

Unit: tfNumerics

Class Methods
Abs Returns absolute value of a BigInteger instance
DivRem Computes Quotient and Remainder from integer division
Pow Raises a BigInteger value to the power
PowerOfTwo Returns BigInteger instance representing a given power of 2
Sqr Computes square of a BigInteger value
Sqrt Computes square root from a BigInteger value
GCD Computes greatest common divisor of two numbers
EGCD Extended Euclidean algorithm
LCM Computes least common multiple of two numbers
ModPow Raises a number to the power over the modulus
ModInverse Computes modular inverse of a BigInteger value
Parse Converts the string representation of a number to BigInteger
TryParse Converts the string representation of a number to BigInteger
Instance Methods
IsPowerOfTwo Checks if a BigInteger instance is a power of 2
Next Returns next (incremented by 1) BigInteger value
Prev Returns previous (decremented by 1) BigInteger value
ToString Converts a number to the decimal string
ToHexString Converts a number to the hexadecimal string
HashCode 32-bit hash value for a BigInteger instance
Sign Sign of a BigInteger instance


  • If an uninitialized BigInteger variable is used in an expression, access violation is raised:
  A, B, C: BigInteger;

  A:= 2;
  B:= 3;
  Writeln(A*B);      // 6;
  Writeln(A*C);      // raises EAccessViolation because C is not initialized