BigInteger Support
From The Oxygene Language Wiki
This is a Language topic
Feel free to add your notes to this topic below.
BigInteger is a new type in Microsoft .NET 4.0 that allows arbitrary length signed integer values.
It provides all standard operations for integers and a few extra ones, like Log, ModPow and GreatestCommonDivisor.
Delphi Prism supports virtually unlimited length big integer constants in code. To use this feature, the System.Numerics.dll library has to be referenced. The type itself is defined in the System.Numerics namespace.
var r := 698574357436578436543275894375984326598342759435634977653476574392865784356; var y := 8574398256943285643296524390; Console.WriteLine(y); Console.WriteLine(r); y := r - y; Console.WriteLine(y);
Additional Operations
| | |
|---|---|
| Abs | Returns the absolute value (if it is negative, 0 minus the value is returned, else the original is returned) |
| DivRem | Divides two big integers and returns both the result and the remainder |
| Log | Natural and double value based logarithm of a big integer |
| Log10 | Base 10 Logarithm of a specific big integer |
| ModPow | Does a modulus division (remainder) of a value raised to the power of another value (often used in RSA) |
| Pow | Raises a number of the power of another number |
| GreatestCommonDivisor | Returns the GCD of two values (the largest number that both can be divided by without leaving a remainder) |
See Also
Area: Oxygene Language
Compiler version: Oxygene 5
Language Glossary — Keywords — Types — FAQ — How To