Search notes:

System.Numerics.BigInteger (struct)

System.Numerics.BigInteger represents a theoretically arbitrary large number

Properties and methods

Abs()
Add()
Compare()
CompareTo()
Divide()
DivRem()
Equals()
GetBitLength()
GetByteCount()
GetHashCode()
GreatestCommonDivisor()
IsEven
IsOne
IsPowerOfTwo
IsZero
Log()
Log10()
Max()
Min()
MinusOne
ModPow()
Multiply()
Negate()
One
Parse() A static method to creates a BigInteger from a textual representation of a number. Compare with ToString()
Pow()
Remainder()
Sign
Subtract()
ToByteArray()
ToString() Creates a textual representation of the big integer in different formats, for example bigNum.ToString("X") returns the number's hexadecimal representation. Compare with Parse()
TryFormat()
TryParse()
TryWriteBytes()
Zero

Inetersting ways to create a big integer

There are multiple constructors for BigInteger. One interesting constructors takes an array of bytes to construct the big integer
[byte[]] $bytes = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
$bigInt = [System.Numerics.BigInteger]::new($bytes)
The first byte in the is the least signifcant, the last byte the most signifcant one:
$bigInt.ToString("X")
0A090807060504030201
A big integer can alternatively be created from a textual representation of the number (i. e. a string) like so:
$bigInt = [System.Numerics.BigInteger]::Parse("47390263963055590408705")

PowerShell data type suffix for BigInteger

In PowerShell, the data type suffix for integers to indicate a BigInteger is n:
PS C:\> (123456789012345678901234567890n).GetType().FullName
System.Numerics.BigInteger

See also

Integral numeric types
The PowerShell Type accelerator for BigInteger is [bigint].
In Python 3, an int is unlimited as well.

Index