Duke's Big Numbers 1.0
C++ and Blueprint libraries for performing math, analysis, and formatting with really large numbers (>10e308).
|
#include "BigInteger.h"
Public Member Functions | |
FBigInteger () | |
FBigInteger (bool value) | |
FBigInteger (int8 value) | |
FBigInteger (uint8 value) | |
FBigInteger (int16 value) | |
FBigInteger (uint16 value) | |
FBigInteger (int32 value) | |
FBigInteger (uint32 value) | |
FBigInteger (int64 value) | |
FBigInteger (uint64 value) | |
FBigInteger (float value) | |
FBigInteger (double value) | |
FBigInteger (const TArray< uint8 > &value) | |
FBigInteger (const TArray< uint8 > &magnitude, bool isNegative) | |
FBigInteger (const TArray< uint32 > &value) | |
FBigInteger (const TArray< uint32 > &magnitude, bool isNegative) | |
FBigInteger | Add (const FBigInteger &rhs) const |
FBigInteger | Subtract (const FBigInteger &rhs) const |
FBigInteger | Multiply (const FBigInteger &rhs) const |
FBigInteger | Divide (uint32 rhs) const |
FBigInteger | Divide (uint64 rhs) const |
FBigInteger | Divide (const FBigInteger &rhs) const |
uint32 | Remainder (uint32 rhs) const |
uint64 | Remainder (uint64 rhs) const |
FBigInteger | Remainder (const FBigInteger &rhs) const |
uint32 | DivRem (const uint32 divisor, FBigInteger "ient) const |
uint64 | DivRem (const uint64 divisor, FBigInteger "ient) const |
FBigInteger | DivRem (const FBigInteger &divisor, FBigInteger "ient) const |
FBigInteger | And (const FBigInteger &rhs) const |
FBigInteger | Or (const FBigInteger &rhs) const |
FBigInteger | Xor (const FBigInteger &rhs) const |
FBigInteger | Invert () const |
FBigInteger | Increment () const |
FBigInteger | Decrement () const |
FBigInteger | ClearBit (int32 bitIndex) const |
FBigInteger | SetBit (int32 bitIndex) const |
FBigInteger | ToggleBit (int32 bitIndex) const |
FBigInteger | SetWord (int32 index, uint32 word) const |
FBigInteger | ShiftLeft (int32 shift) const |
FBigInteger | ShiftRight (int32 shift) const |
FBigInteger | Negate () const |
FBigInteger | SetSign (bool isNegative) const |
FBigInteger | Abs () const |
FBigInteger | Nabs () const |
FBigInteger | CopySign (const FBigInteger &rhs) const |
const FBigInteger & | Clamp (const FBigInteger &min, const FBigInteger &max) const |
int32 | CountPrecisionBits () const |
int32 | Nlz () const |
int32 | Ntz () const |
int32 | Pop () const |
void | GetBaseTwoComponents (uint32 &mantissa, int32 &exponent) const |
void | GetBaseTwoComponents (uint64 &mantissa, int32 &exponent) const |
int32 | GetSign () const |
int32 | GetSignedBitLength () const |
int32 | GetSignedByteLength () const |
int32 | GetSignedWordLength () const |
int32 | GetLength () const |
int32 | GetBit (int32 position) const |
uint32 | GetUpperWord () const |
uint32 | GetWord (int32 index) const |
uint32 | FloorLog10 () const |
uint32 | FloorLog2 () const |
float | Log10 () const |
double | Log10D () const |
float | Log2 () const |
double | Log2D () const |
float | Loge () const |
double | LogeD () const |
float | LogX (float base) const |
double | LogX (double base) const |
FBigInteger | Pow (int32 exponent) const |
FBigInteger | Pow (float exponent) const |
FBigInteger | Sqrt () const |
bool | CanFitIntoInt () const |
bool | CanFitIntoUInt () const |
bool | CanFitIntoInt64 () const |
bool | CanFitIntoUInt64 () const |
bool | CanFitIntoFloat () const |
bool | CanFitIntoFloatLossy () const |
bool | CanFitIntoDouble () const |
bool | CanFitIntoDoubleLossy () const |
bool | IsEven () const |
bool | IsMinusOne () const |
bool | IsNegative () const |
bool | IsOdd () const |
bool | IsOne () const |
bool | IsPositive () const |
bool | IsPowerOfTwo () const |
bool | IsZero () const |
int32 | CompareTo (int32 rhs) const |
int32 | CompareTo (uint32 rhs) const |
int32 | CompareTo (int64 rhs) const |
int32 | CompareTo (uint64 rhs) const |
int32 | CompareTo (const FBigInteger &rhs) const |
int32 | CompareMagnitudeTo (const FBigInteger &rhs) const |
FString | ToString () const |
FString | ToHexString () const |
FBigInteger | operator+ () const |
FBigInteger | operator- () const |
bool | operator! () const |
FBigInteger | operator~ () const |
FBigInteger & | operator++ () |
FBigInteger | operator++ (int) |
FBigInteger & | operator-- () |
FBigInteger | operator-- (int) |
FBigInteger & | operator+= (const FBigInteger &rhs) |
FBigInteger & | operator-= (const FBigInteger &rhs) |
FBigInteger & | operator*= (const FBigInteger &rhs) |
FBigInteger & | operator/= (const uint32 rhs) |
FBigInteger & | operator/= (const uint64 rhs) |
FBigInteger & | operator/= (const FBigInteger &rhs) |
FBigInteger & | operator%= (const FBigInteger &rhs) |
FBigInteger & | operator&= (const FBigInteger &rhs) |
FBigInteger & | operator|= (const FBigInteger &rhs) |
FBigInteger & | operator^= (const FBigInteger &rhs) |
FBigInteger & | operator>>= (int32 shift) |
FBigInteger & | operator<<= (int32 shift) |
void | operator= (bool from) |
void | operator= (int8 from) |
void | operator= (uint8 from) |
void | operator= (int16 from) |
void | operator= (uint16 from) |
void | operator= (int32 from) |
void | operator= (uint32 from) |
void | operator= (int64 from) |
void | operator= (uint64 from) |
void | operator= (float from) |
void | operator= (double from) |
operator bool () const | |
operator int8 () const | |
operator uint8 () const | |
operator int16 () const | |
operator uint16 () const | |
operator int32 () const | |
operator uint32 () const | |
operator int64 () const | |
operator uint64 () const | |
operator float () const | |
operator double () const | |
operator TArray< uint8 > () const | |
operator TArray< uint32 > () const | |
void | SetValueIn (bool value) |
void | SetValueIn (int8 value) |
void | SetValueIn (uint8 value) |
void | SetValueIn (int16 value) |
void | SetValueIn (uint16 value) |
void | SetValueIn (int32 value) |
void | SetValueIn (uint32 value) |
void | SetValueIn (int64 value) |
void | SetValueIn (uint64 value) |
void | SetValueIn (float value) |
void | SetValueIn (double value) |
void | SetValueIn (const FBigInteger &value) |
void | SetValueIn (const TArray< uint8 > &value) |
void | SetValueIn (const TArray< uint8 > &magnitude, bool isNegative) |
void | SetValueIn (const TArray< uint32 > &value) |
void | SetValueIn (const TArray< uint32 > &magnitude, bool isNegative) |
void | AddIn (const FBigInteger &rhs) |
void | SubtractIn (const FBigInteger &rhs) |
FBigInteger | DivRemIn (const FBigInteger &divisor) |
void | AndIn (const FBigInteger &rhs) |
void | OrIn (const FBigInteger &rhs) |
void | XorIn (const FBigInteger &rhs) |
void | InvertIn () |
void | IncrementIn () |
void | DecrementIn () |
void | ClearBitIn (int32 bitIndex) |
void | SetBitIn (int32 bitIndex) |
void | ToggleBitIn (int32 bitIndex) |
void | SetWordIn (int32 index, uint32 word) |
void | ShiftLeftIn (int32 shift) |
void | ShiftRightIn (int32 shift) |
void | NegateIn () |
void | SetSignIn (bool isNegative) |
void | AbsIn () |
void | NabsIn () |
void | CopySignIn (const FBigInteger &rhs) |
void | MaxIn (const FBigInteger &rhs) |
void | MinIn (const FBigInteger &rhs) |
void | MaxMagnitudeIn (const FBigInteger &rhs) |
void | MinMagnitudeIn (const FBigInteger &rhs) |
void | SelectIn (const FBigInteger &rhs, bool condition) |
void | ClampIn (const FBigInteger &min, const FBigInteger &max) |
Static Public Member Functions | |
static FBigInteger | Add (const FBigInteger &lhs, const FBigInteger &rhs) |
static FBigInteger | Subtract (const FBigInteger &lhs, const FBigInteger &rhs) |
static FBigInteger | Multiply (const FBigInteger &lhs, const FBigInteger &rhs) |
static FBigInteger | Divide (const FBigInteger &lhs, uint32 rhs) |
static FBigInteger | Divide (const FBigInteger &lhs, uint64 rhs) |
static FBigInteger | Divide (const FBigInteger &lhs, const FBigInteger &rhs) |
static uint32 | Remainder (const FBigInteger &lhs, const uint32 rhs) |
static uint64 | Remainder (const FBigInteger &lhs, const uint64 rhs) |
static FBigInteger | Remainder (const FBigInteger &lhs, const FBigInteger &rhs) |
static uint32 | DivRem (const FBigInteger &lhs, uint32 rhs, FBigInteger "ient) |
static uint64 | DivRem (const FBigInteger &lhs, uint64 rhs, FBigInteger "ient) |
static FBigInteger | DivRem (const FBigInteger &lhs, const FBigInteger &rhs, FBigInteger "ient) |
static FBigInteger | And (const FBigInteger &lhs, const FBigInteger &rhs) |
static FBigInteger | Or (const FBigInteger &lhs, const FBigInteger &rhs) |
static FBigInteger | Xor (const FBigInteger &lhs, const FBigInteger &rhs) |
static FBigInteger | Invert (const FBigInteger &value) |
static FBigInteger | Increment (const FBigInteger &value) |
static FBigInteger | Decrement (const FBigInteger &value) |
static FBigInteger | ClearBit (const FBigInteger &value, int32 bitIndex) |
static FBigInteger | SetBit (const FBigInteger &value, int32 bitIndex) |
static FBigInteger | ToggleBit (const FBigInteger &value, int32 bitIndex) |
static FBigInteger | SetWord (const FBigInteger &value, int32 index, uint32 word) |
static FBigInteger | ShiftLeft (const FBigInteger &value, int32 shift) |
static FBigInteger | ShiftRight (const FBigInteger &value, int32 shift) |
static FBigInteger | Negate (const FBigInteger &value) |
static FBigInteger | SetSign (const FBigInteger &value, bool isNegative) |
static FBigInteger | Abs (const FBigInteger &value) |
static FBigInteger | Nabs (const FBigInteger &value) |
static FBigInteger | CopySign (const FBigInteger &lhs, const FBigInteger &rhs) |
static const FBigInteger & | Max (const FBigInteger &lhs, const FBigInteger &rhs) |
static const FBigInteger & | MaxMagnitude (const FBigInteger &lhs, const FBigInteger &rhs) |
static const FBigInteger & | Min (const FBigInteger &lhs, const FBigInteger &rhs) |
static const FBigInteger & | MinMagnitude (const FBigInteger &lhs, const FBigInteger &rhs) |
static const FBigInteger & | Select (const FBigInteger &whenTrue, const FBigInteger &whenFalse, bool condition) |
static const FBigInteger & | Clamp (const FBigInteger &value, const FBigInteger &min, const FBigInteger &max) |
static int32 | CountPrecisionBits (const FBigInteger &value) |
static int32 | Nlz (const FBigInteger &value) |
static int32 | Ntz (const FBigInteger &value) |
static int32 | Pop (const FBigInteger &value) |
static int32 | Compare (int32 lhs, const FBigInteger &rhs) |
static int32 | Compare (uint32 lhs, const FBigInteger &rhs) |
static int32 | Compare (int64 lhs, const FBigInteger &rhs) |
static int32 | Compare (uint64 lhs, const FBigInteger &rhs) |
static int32 | Compare (const FBigInteger &lhs, int32 rhs) |
static int32 | Compare (const FBigInteger &lhs, uint32 rhs) |
static int32 | Compare (const FBigInteger &lhs, int64 rhs) |
static int32 | Compare (const FBigInteger &lhs, uint64 rhs) |
static int32 | Compare (const FBigInteger &lhs, const FBigInteger &rhs) |
static int32 | CompareMagnitude (const FBigInteger &lhs, const FBigInteger &rhs) |
static uint32 | FloorLog10 (const FBigInteger &value) |
static uint32 | FloorLog2 (const FBigInteger &value) |
static float | Log10 (const FBigInteger &value) |
static double | Log10D (const FBigInteger &value) |
static float | Log2 (const FBigInteger &value) |
static double | Log2D (const FBigInteger &value) |
static float | Loge (const FBigInteger &value) |
static double | LogeD (const FBigInteger &value) |
static float | LogX (float base, const FBigInteger &value) |
static double | LogX (double base, const FBigInteger &value) |
static FBigInteger | Pow (int32 base, int32 exponent) |
static FBigInteger | Pow (const FBigInteger &base, int32 exponent) |
static FBigInteger | Pow (const FBigInteger &base, float exponent) |
static FBigInteger | Sqrt (const FBigInteger &value) |
static uint32 | Gcd (const FBigInteger &lhs, uint32 rhs) |
static uint64 | Gcd (const FBigInteger &lhs, uint64 rhs) |
static FBigInteger | Gcd (const FBigInteger &lhs, const FBigInteger &rhs) |
Static Public Attributes | |
static const FBigInteger | Zero |
static const FBigInteger | One |
static const FBigInteger | MinusOne |
Friends | |
FBigInteger | operator+ (FBigInteger lhs, const FBigInteger &rhs) |
FBigInteger | operator- (FBigInteger lhs, const FBigInteger &rhs) |
FBigInteger | operator* (FBigInteger lhs, const FBigInteger &rhs) |
FBigInteger | operator/ (FBigInteger lhs, const uint32 rhs) |
FBigInteger | operator/ (FBigInteger lhs, const uint64 rhs) |
FBigInteger | operator/ (FBigInteger lhs, const FBigInteger &rhs) |
uint32 | operator% (FBigInteger lhs, const uint32 rhs) |
uint64 | operator% (FBigInteger lhs, const uint64 rhs) |
FBigInteger | operator% (FBigInteger lhs, const FBigInteger &rhs) |
FBigInteger | operator& (FBigInteger lhs, const FBigInteger &rhs) |
FBigInteger | operator| (FBigInteger lhs, const FBigInteger &rhs) |
FBigInteger | operator^ (FBigInteger lhs, const FBigInteger &rhs) |
FBigInteger | operator<< (FBigInteger lhs, int32 shift) |
FBigInteger | operator>> (FBigInteger lhs, int32 shift) |
bool | operator== (int32 lhs, const FBigInteger &rhs) |
bool | operator== (uint32 lhs, const FBigInteger &rhs) |
bool | operator== (int64 lhs, const FBigInteger &rhs) |
bool | operator== (uint64 lhs, const FBigInteger &rhs) |
bool | operator== (const FBigInteger &lhs, int32 rhs) |
bool | operator== (const FBigInteger &lhs, uint32 rhs) |
bool | operator== (const FBigInteger &lhs, int64 rhs) |
bool | operator== (const FBigInteger &lhs, uint64 rhs) |
bool | operator== (const FBigInteger &lhs, const FBigInteger &rhs) |
bool | operator!= (int32 lhs, const FBigInteger &rhs) |
bool | operator!= (uint32 lhs, const FBigInteger &rhs) |
bool | operator!= (int64 lhs, const FBigInteger &rhs) |
bool | operator!= (uint64 lhs, const FBigInteger &rhs) |
bool | operator!= (const FBigInteger &lhs, int32 rhs) |
bool | operator!= (const FBigInteger &lhs, uint32 rhs) |
bool | operator!= (const FBigInteger &lhs, int64 rhs) |
bool | operator!= (const FBigInteger &lhs, uint64 rhs) |
bool | operator!= (const FBigInteger &lhs, const FBigInteger &rhs) |
bool | operator< (int32 lhs, const FBigInteger &rhs) |
bool | operator< (uint32 lhs, const FBigInteger &rhs) |
bool | operator< (int64 lhs, const FBigInteger &rhs) |
bool | operator< (uint64 lhs, const FBigInteger &rhs) |
bool | operator< (const FBigInteger &lhs, const int32 rhs) |
bool | operator< (const FBigInteger &lhs, const uint32 rhs) |
bool | operator< (const FBigInteger &lhs, const int64 rhs) |
bool | operator< (const FBigInteger &lhs, const uint64 rhs) |
bool | operator< (const FBigInteger &lhs, const FBigInteger &rhs) |
bool | operator> (int32 lhs, const FBigInteger &rhs) |
bool | operator> (uint32 lhs, const FBigInteger &rhs) |
bool | operator> (int64 lhs, const FBigInteger &rhs) |
bool | operator> (uint64 lhs, const FBigInteger &rhs) |
bool | operator> (const FBigInteger &lhs, int32 rhs) |
bool | operator> (const FBigInteger &lhs, uint32 rhs) |
bool | operator> (const FBigInteger &lhs, int64 rhs) |
bool | operator> (const FBigInteger &lhs, uint64 rhs) |
bool | operator> (const FBigInteger &lhs, const FBigInteger &rhs) |
bool | operator<= (int32 lhs, const FBigInteger &rhs) |
bool | operator<= (uint32 lhs, const FBigInteger &rhs) |
bool | operator<= (int64 lhs, const FBigInteger &rhs) |
bool | operator<= (uint64 lhs, const FBigInteger &rhs) |
bool | operator<= (const FBigInteger &lhs, int32 rhs) |
bool | operator<= (const FBigInteger &lhs, uint32 rhs) |
bool | operator<= (const FBigInteger &lhs, int64 rhs) |
bool | operator<= (const FBigInteger &lhs, uint64 rhs) |
bool | operator<= (const FBigInteger &lhs, const FBigInteger &rhs) |
bool | operator>= (int32 lhs, const FBigInteger &rhs) |
bool | operator>= (uint32 lhs, const FBigInteger &rhs) |
bool | operator>= (int64 lhs, const FBigInteger &rhs) |
bool | operator>= (uint64 lhs, const FBigInteger &rhs) |
bool | operator>= (const FBigInteger &lhs, int32 rhs) |
bool | operator>= (const FBigInteger &lhs, uint32 rhs) |
bool | operator>= (const FBigInteger &lhs, int64 rhs) |
bool | operator>= (const FBigInteger &lhs, uint64 rhs) |
bool | operator>= (const FBigInteger &lhs, const FBigInteger &rhs) |
Represents and performs operations on integer values of arbitrary scale.
This structure is akin to the C# System.Numerics.BigInteger class. It has some important design differences to help reduce memory allocations - notably this class does not use a register/builder class behind the scenes for calculation and it instead uses its own bit storage as a register for operations, avoiding allocations and copies where possible.
Supports basic aritmetic operations up through exponents and roots. Yes, unlike C# BigInteger, arbitrary roots and float exponents are possible (though slow) with this class.
|
Flavor:Constructor |
Initializes a BigInteger
BI ← bi 0
|
explicitFlavor:Constructor |
Initializes a BigInteger from a bool value
value | The value with which to initialize the BigInteger |
BI ← bi B
|
Flavor:Constructor |
Initializes a BigInteger from an int8 value
value | The value with which to initialize the BigInteger |
BI ← bi I1
|
Flavor:Constructor |
Initializes a BigInteger from a uint8 value
value | The value with which to initialize the BigInteger |
BI ← bi U1
|
Flavor:Constructor |
Initializes a BigInteger from an int16 value
value | The value with which to initialize the BigInteger |
BI ← bi I2
|
Flavor:Constructor |
Initializes a BigInteger from a uint16 value
value | The value with which to initialize the BigInteger |
BI ← bi U2
|
Flavor:Constructor |
Initializes a BigInteger from a int32 value
value | The value with which to initialize the BigInteger |
BI ← bi I4
|
Flavor:Constructor |
Initializes a BigInteger from a uint32 value
value | The value with which to initialize the BigInteger |
BI ← bi U4
|
Flavor:Constructor |
Initializes a BigInteger from a int64 value
value | The value with which to initialize the BigInteger |
BI ← bi I8
|
explicitFlavor:Constructor |
Initializes a BigInteger from a uint64 value
value | The value with which to initialize the BigInteger |
BI ← bi U8
|
Flavor:Constructor |
Initializes a BigInteger from a float value
value | The value with which to initialize the BigInteger |
BI ← bi F4
|
Flavor:Constructor |
Initializes a BigInteger from a double value
value | The value with which to initialize the BigInteger |
BI ← bi F8
|
explicitFlavor:Constructor |
Initializes a BigInteger from a TArray<uint8>
value | The word values with which to initialize the BigInteger |
BI ← bi U1[]
|
Flavor:Constructor |
Initializes a BigInteger from a TArray<uint8>
magnitude | The magnitude with which to initialize the BigInteger |
isNegative | Whether the number should be negative |
BI ← bi U1[] B
|
explicitFlavor:Constructor |
Initializes a BigInteger from a TArray<uint32>
value | The word values with which to initialize the BigInteger |
BI ← bi U4[]
|
Flavor:Constructor |
Initializes a BigInteger from a TArray<uint32>
magnitude | The magnitude with which to initialize the BigInteger |
isNegative | Whether the number should be negative |
BI ← bi U4[] B
|
Flavor:Instance |
Computes the absolute value of the number
BI ← abs BI
|
staticFlavor:Static |
Copies value, computes the absolute value on the copy, and returns the copy
value | The number for which to compute the absolute value |
BI ← abs BI
|
Flavor:Mutating |
Sets the sign of this number to positive
0 ← abs BI
|
staticFlavor:Static |
Adds the two values and returns the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← add BI BI
|
Flavor:Instance |
Adds another value to this one and returns the result
rhs | The value for the right hand side of this operation |
BI ← add BI BI
|
Flavor:Mutating |
Adds another BigInteger to this one, overwriting this instance with the result.
rhs | The value for the right hand side of this operation |
0 ← add BI BI
|
staticFlavor:Static |
Logically ANDs lhs and rhs and returns the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← and BI BI
|
Flavor:Instance |
Logically ANDs this number with rhs and returns the result
rhs | The value for the right hand side of this operation |
BI ← and BI BI
|
Flavor:Mutating |
Logically ANDs another BigInteger with this one, overwriting this instance with the result.
rhs | The value for the right hand side of this operation |
0 ← and BI BI
|
Flavor:Instance |
Gets whether the number can be cast to a double without loss of information
B ← fitf8 BI
|
Flavor:Instance |
Gets whether the number can be cast to a double without overflow, but while possibly losing precision
B ← fitlf8 BI
|
Flavor:Instance |
Gets whether the number can be cast to a float without loss of information
B ← fitf4 BI
|
Flavor:Instance |
Gets whether the number can be cast to a float without overflow, but while possibly losing precision
B ← fitlf4 BI
|
Flavor:Instance |
Gets whether the number can be cast to an int32 without loss of information
B ← fiti4 BI
|
Flavor:Instance |
Gets whether the number can be cast to an int64 without loss of information
B ← fiti8 BI
|
Flavor:Instance |
Gets whether the number can be cast to a uint32 without loss of information
B ← fitu4 BI
|
Flavor:Instance |
Gets whether the number can be cast to a uint64 without loss of information
B ← fitu8 BI
|
Flavor:Instance |
Constrains the value to be within min and max
min | The minimum desired value |
max | The maximum desired value |
BI ← clamp BI BI BI
|
staticFlavor:Static |
Constrains the value to be within min and max
value | The value to check and constrain |
min | The minimum desired value |
max | The maximum desired value |
BI ← clamp BI BI BI
|
Flavor:Mutating |
Clamps this betwen min and max If the value of this is less than min, the value of this is set to min. If the value of this is greater than max, the value of this is set to max. Otherwise, this is unmodified.
min | The number to use as the minimum bound |
max | The number to use as the minimum bound |
0 ← clamp BI BI BI
|
staticFlavor:Static |
Returns a new number copied from value, with the specified bit cleared
value | The value to copy and modify |
bitIndex | The index of the bit to modify |
BI ← clrbit BI I4
|
Flavor:Instance |
Returns a new number with the specified bit cleared
bitIndex | The index of the bit to modify |
BI ← clrbit BI I4
|
Flavor:Mutating |
Clears the specified bit in this number
bitIndex | The index of the bit to modify |
0 ← clrbit BI I4
|
staticFlavor:Static |
Compares two numbers and provides the result as a standard three-way comparison value
lhs | The number for the left side of the comparison |
rhs | The number for the right side of the comparison |
I4 ← cmp BI BI
|
staticFlavor:Static |
Compares two numbers and provides the result as a standard three-way comparison value
lhs | The number for the left side of the comparison |
rhs | The number for the right side of the comparison |
I4 ← cmp BI I4
|
staticFlavor:Static |
Compares two numbers and provides the result as a standard three-way comparison value
lhs | The number for the left side of the comparison |
rhs | The number for the right side of the comparison |
I4 ← cmp BI I8
|
staticFlavor:Static |
Compares two numbers and provides the result as a standard three-way comparison value
lhs | The number for the left side of the comparison |
rhs | The number for the right side of the comparison |
I4 ← cmp BI U4
|
staticFlavor:Static |
Compares two numbers and provides the result as a standard three-way comparison value
lhs | The number for the left side of the comparison |
rhs | The number for the right side of the comparison |
I4 ← cmp BI U8
|
staticFlavor:Static |
Compares two numbers and provides the result as a standard three-way comparison value
lhs | The number for the left side of the comparison |
rhs | The number for the right side of the comparison |
I4 ← cmp I4 BI
|
staticFlavor:Static |
Compares two numbers and provides the result as a standard three-way comparison value
lhs | The number for the left side of the comparison |
rhs | The number for the right side of the comparison |
I4 ← cmp I8 BI
|
staticFlavor:Static |
Compares two numbers and provides the result as a standard three-way comparison value
lhs | The number for the left side of the comparison |
rhs | The number for the right side of the comparison |
I4 ← cmp U4 BI
|
staticFlavor:Static |
Compares two numbers and provides the result as a standard three-way comparison value
lhs | The number for the left side of the comparison |
rhs | The number for the right side of the comparison |
I4 ← cmp U8 BI
|
staticFlavor:Static |
Compares the magnitude of two numbers disregarding sign, and provides the result as a standard three-way comparison value
lhs | The number for the left side of the comparison |
rhs | The number for the right side of the comparison |
I4 ← cmpmag BI BI
|
Flavor:Instance |
Compares the magnitude of this number to another number disregarding sign, and provides the result as a standard three-way comparison value
rhs | The number for the right side of the comparison |
I4 ← cmpmag BI BI
|
Flavor:Instance |
Compares this number to another number and provides the result as a standard three-way comparison value
rhs | The number for the right side of the comparison |
I4 ← cmp BI BI
|
Flavor:Instance |
Compares this number to another number and provides the result as a standard three-way comparison value
rhs | The number for the right side of the comparison |
I4 ← cmp BI I4
|
Flavor:Instance |
Compares this number to another number and provides the result as a standard three-way comparison value
rhs | The number for the right side of the comparison |
I4 ← cmp BI I8
|
Flavor:Instance |
Compares this number to another number and provides the result as a standard three-way comparison value
rhs | The number for the right side of the comparison |
I4 ← cmp BI U4
|
Flavor:Instance |
Compares this number to another number and provides the result as a standard three-way comparison value
rhs | The number for the right side of the comparison |
I4 ← cmp BI U8
|
staticFlavor:Static |
Takes the magnitude of lhs and writes the sign from rhs to it.
lhs | The number that contributes the magnitude of the result |
rhs | The number that contributes the sign of the result |
BI ← cpysgn BI BI
|
Flavor:Instance |
Takes the magnitude of this value and writes the sign from rhs to it.
rhs | The number that contributes the sign of the result |
BI ← cpysgn BI BI
|
Flavor:Mutating |
Applies the sign from rhs to this. If this is zero, this will not be affected.
rhs | The number to apply the sign from |
0 ← cpysgn BI BI
|
Flavor:Instance |
Gets the count of precision bits used in the number
I4 ← clamp BI
|
staticFlavor:Static |
Gets the count of precision bits used in value
value | The number for which to get the bit count |
I4 ← prec BI
|
Flavor:Instance |
Copies this and decrements the copy before returning it
BI ← decpre BI
|
staticFlavor:Static |
Copies value and decrements the copy before returning it
value | The value to decrement |
BI ← decpre BI
|
Flavor:Mutating |
Decrements this
0 ← decpre BI
|
staticFlavor:Static |
Divides lhs by rhs and returns the quotient as the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← div BI BI
|
staticFlavor:Static |
Divides lhs by rhs and returns the quotient as the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← div BI U4
|
staticFlavor:Static |
Divides lhs by rhs and returns the quotient as the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← div BI U8
|
Flavor:Instance |
Divides this number by rhs and returns the quotient as the result
rhs | The value for the right hand side of this operation |
BI ← div BI BI
|
Flavor:Instance |
Divides this number by rhs and returns the quotient as the result
rhs | The value for the right hand side of this operation |
BI ← div BI U4
|
Flavor:Instance |
Divides this number by rhs and returns the quotient as the result
rhs | The value for the right hand side of this operation |
BI ← div BI U8
|
Flavor:Instance |
Divides this number by the given divisor and returns the remainder as the result, also outputting the quotient.
divisor | The value for the divisor for this operation |
quotient | On return, contains the signed quotient of the division |
BI ← divrem BI BI BI&
|
staticFlavor:Static |
Divides lhs by rhs and outputs the quotient and the remainder
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
quotient | Value reference that will receive the signed quotient of the division |
BI ← divrem BI BI BI&
|
staticFlavor:Static |
Divides lhs by rhs and outputs the quotient and the remainder
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
quotient | Value reference that will receive the signed quotient of the division |
U4 ← divrem BI U4 BI&
|
staticFlavor:Static |
Divides lhs by rhs and outputs the quotient and the remainder
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
quotient | Value reference that will receive the signed quotient of the division |
U8 ← divrem BI U8 BI&
|
Flavor:Instance |
Divides this number by the given divisor and returns the remainder as the result, also outputting the quotient.
divisor | The value for the divisor of this operation |
quotient | On return, contains the signed quotient of the division |
U4 ← divrem BI U4 BI&
|
Flavor:Instance |
Divides this number by the given divisor and returns the remainder as the result, also outputting the quotient.
divisor | The value for the divisor of this operation |
quotient | On return, contains the signed quotient of the division |
U8 ← divrem BI U8 BI&
|
Flavor:Mutating |
Divides this number by the given divisor and returns the quotient as the result, leaving the remainder in this number.
divisor | The value for the divisor of this operation |
BI ← divrem BI
|
Flavor:Instance |
Computes the base 10 logarithm of the given base of the number as a uint32.
U4 ← flog10 BI
|
staticFlavor:Static |
Computes the base 10 logarithm of the given base of the number as a uint32.
value | The number to compute the logarithm for |
U4 ← flog10 BI
|
Flavor:Instance |
Computes the base 2 logarithm of the given base of the number as a uint32.
U4 ← flog2 BI
|
staticFlavor:Static |
Computes the base 2 logarithm of the given base of the number as a uint32.
value | The number to compute the logarithm for |
U4 ← flog2 BI
|
staticFlavor:Static |
Gets the greatest common divisor (GCD) between two numbers.
lhs | The left number for which to calculate GCD |
rhs | The right number for which to calculate GCD |
BI ← gcd BI BI
|
staticFlavor:Static |
Gets the greatest common divisor (GCD) between two numbers.
lhs | The left number for which to calculate GCD |
rhs | The right number for which to calculate GCD |
U4 ← gcd BI U4
|
staticFlavor:Static |
Gets the greatest common divisor (GCD) between two numbers.
lhs | The left number for which to calculate GCD |
rhs | The right number for which to calculate GCD |
U8 ← gcd BI U8
|
Flavor:Instance |
Computes an IEEE-style base two mantissa and exponent for the number
mantissa | On return, contains the mantissa of the number |
exponent | On return, contains the exponent of the number |
0 ← manexp BI U4& I4&
|
Flavor:Instance |
Computes an IEEE-style base two mantissa and exponent for the number
mantissa | On return, contains the mantissa of the number |
exponent | On return, contains the exponent of the number |
0 ← manexp BI U8& I4&
|
Flavor:Instance |
Extracts the bit at the given bit position
position | The position of the bit to extract |
I4 ← bit BI i4
|
Flavor:Instance |
Gets the length of the number in 32-bit unsigned words, not accounting for sign
I4 ← uu4len BI
|
Flavor:Instance |
Gets the sign of the number
I4 ← sgn BI
|
Flavor:Instance |
Gets the bit length needed to hold the number in twos complement format.
I4 ← sblen BI
|
Flavor:Instance |
Gets the byte length needed to hold the number in twos complement format.
I4 ← su1len BI
|
Flavor:Instance |
Gets the number of 32 bit words needed to hold the number in twos complement format.
I4 ← su4len BI
|
Flavor:Instance |
Gets the uppermost 32-bit word of the number
U4 ← topwrd BI
|
Flavor:Instance |
Gets the 32-bit word within the number located at the specified word index
index | The index of the word to retrieve |
U4 ← wrd BI I4
|
Flavor:Instance |
Copies this and increments the copy before returning it
BI ← incpre BI
|
staticFlavor:Static |
Copies value and increments the copy before returning it
value | The value to increment |
BI ← incpre BI
|
Flavor:Mutating |
Increments this
0 ← incpre BI
|
Flavor:Instance |
Returns a bitwise inverted copy of this.
BI ← inv BI
|
staticFlavor:Static |
Performs bitwise inversion on value
value | The value to be inverted |
BI ← inv BI
|
Flavor:Mutating |
Performs bitwise inversion on this BigInteger
BI ← inv BI
|
Flavor:Instance |
Gets whether the number is even.
B ← iseven BI
|
Flavor:Instance |
Gets whether the number is equal to negative one.
B ← isneg1 BI
|
Flavor:Instance |
Gets whether the number is negative
B ← isneg BI
|
Flavor:Instance |
Gets whether the number is odd.
B ← isodd BI
|
Flavor:Instance |
Gets whether the number is equal to one.
B ← isone BI
|
Flavor:Instance |
Gets whether the number is positive
B ← ispos BI
|
Flavor:Instance |
Gets whether the number is a power of two
B ← ispot BI
|
Flavor:Instance |
Gets whether the number is equal to zero.
B ← iszero BI
|
Flavor:Instance |
Computes the base 10 logarithm of the number as a float
F4 ← log10 BI
|
staticFlavor:Static |
Computes the base 10 logarithm of the number as a float
value | The number to compute the logarithm for |
F4 ← log10 BI
|
Flavor:Instance |
Computes the base 10 logarithm of the number as a double
F8 ← log10d BI
|
staticFlavor:Static |
Computes the base 10 logarithm of the number as a double
value | The number to compute the logarithm for |
F8 ← log10d BI
|
Flavor:Instance |
Computes the base 2 logarithm of the number as a float
F4 ← log2 BI
|
staticFlavor:Static |
Computes the base 2 logarithm of the number as a float
value | The number to compute the logarithm for |
F4 ← log2 BI
|
Flavor:Instance |
Computes the base 2 logarithm of the number as a double
F8 ← log2d BI
|
staticFlavor:Static |
Computes the base 2 logarithm of the number as a double
value | The number to compute the logarithm for |
F8 ← log2d BI
|
Flavor:Instance |
Computes the base e logarithm of the number as a float
F4 ← loge BI
|
staticFlavor:Static |
Computes the base e logarithm of the number as a float
value | The number to compute the logarithm for |
F4 ← loge BI
|
Flavor:Instance |
Computes the base e logarithm of the number as a double
F8 ← loged BI
|
staticFlavor:Static |
Computes the base e logarithm of the number as a double
value | The number to compute the logarithm for |
F8 ← loged BI
|
Flavor:Instance |
Computes the logarithm of the given base of the number as a double
base | The base of the log to compute |
F8 ← log BI I4
|
staticFlavor:Static |
Computes the logarithm of the given base of the number as a double
base | The base of the log to compute |
value | The number to compute the logarithm for |
F8 ← log BI F8
|
Flavor:Instance |
Computes the logarithm of the given base of the number as a float
base | The base of the log to compute |
F4 ← log BI I4
|
staticFlavor:Static |
Computes the logarithm of the given base of the number as a float
base | The base of the log to compute |
value | The number to compute the logarithm for |
F4 ← log BI F4
|
staticFlavor:Static |
Returns the greater of two values
lhs | The left-hand number to compare |
rhs | The right-hand number to compare |
BI ← max BI BI
|
Flavor:Mutating |
If rhs is greater than this, the value of this is set to rhs. Otherwise, this is unmodified.
rhs | The number to apply if greater than this one |
0 ← max BI BI
|
staticFlavor:Static |
Returns the value with the greater magnitude, disregarding sign
lhs | The left-hand number to compare |
rhs | The right-hand number to compare |
BI ← maxmag BI BI
|
Flavor:Mutating |
If the magnitude of rhs is greater than the magnitude of this, the value of this is set to rhs. Otherwise, this is unmodified.
rhs | The number to apply if greater than this one |
0 ← maxmag BI BI
|
staticFlavor:Static |
Returns the lesser of two values
lhs | The left-hand number to compare |
rhs | The right-hand number to compare |
BI ← min BI BI
|
Flavor:Mutating |
If rhs is less than this, the value of this is set to rhs. Otherwise, this is unmodified.
rhs | The number to apply if less than this one |
0 ← min BI BI
|
staticFlavor:Static |
Returns the value with the lesser magnitude, disregarding sign
lhs | The left-hand number to compare |
rhs | The right-hand number to compare |
BI ← minmag BI BI
|
Flavor:Mutating |
If the magnitude of rhs is less than the magnitude of this, the value of this is set to rhs. Otherwise, this is unmodified.
rhs | The number to apply if less than this one |
0 ← minmag BI BI
|
staticFlavor:Static |
Multiplies the two values and returns the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← mul BI BI
|
Flavor:Instance |
Multiplies this number by another number and returns the result
rhs | The value for the right hand side of this operation |
BI ← mul BI BI
|
Flavor:Instance |
Computes the negative absolute value of the number
BI ← nabs BI
|
staticFlavor:Static |
Copies value, computes the negative absolute value on the copy, and returns the copy
value | The number for which to compute the negative absolute value |
BI ← nabs BI
|
Flavor:Mutating |
Sets the sign of this number to negative
0 ← nabs BI
|
Flavor:Instance |
Negates the value of the number
BI ← neg BI
|
staticFlavor:Static |
Copies value, negates the copy, and returns the copy
value | The number to be negated |
BI ← neg BI
|
Flavor:Mutating |
Negates this number
0 ← neg BI
|
Flavor:Instance |
Gets the count of leading zero bits on the uppermost 32-bit word of the number
I4 ← nlz BI
|
staticFlavor:Static |
Gets the count of leading zero bits on the uppermost 32-bit word of value
value | The number for which to get the bit count |
I4 ← nlz BI
|
Flavor:Instance |
Gets the count of trailing zero bits on the number
I4 ← ntz BI
|
staticFlavor:Static |
Gets the count of trailing zero bits on value
value | The number for which to get the bit count |
I4 ← ntz BI
|
explicitFlavor:Operator |
Converts the value to a bool
B ← b BI
|
explicitFlavor:Operator |
Converts the value to a double
F8 ← f8 BI
|
explicitFlavor:Operator |
Converts the value to a float
F4 ← f4 BI
|
explicitFlavor:Operator |
Converts the value to an int16
I2 ← i2 BI
|
explicitFlavor:Operator |
Converts the value to an int32
I4 ← i4 BI
|
explicitFlavor:Operator |
Converts the value to an int64
I8 ← i8 BI
|
explicitFlavor:Operator |
Converts the value to an int8
I1 ← i1 BI
|
explicitFlavor:Operator |
Converts the value to an array of uint32 representing the number in twos complement format.
U4[] ← u4arr BI
|
explicitFlavor:Operator |
Converts the value to an array of uint8 representing the number in twos complement format.
U1[] ← u1arr BI
|
explicitFlavor:Operator |
Converts the value to a uint16
U2 ← u2 BI
|
explicitFlavor:Operator |
Converts the value to a uint32
U4 ← u4 BI
|
explicitFlavor:Operator |
Converts the value to a uint64
U8 ← u8 BI
|
explicitFlavor:Operator |
Converts the value to a uint8
U1 ← u1 BI
|
Flavor:Operator |
Performs boolean inversion on this BigInteger
B ← not BI
|
Flavor:MutatingOperator |
Calculates the remainder of dividing this value by a BigInteger
rhs | The value for the right hand side of this operation |
BI ← rem BI BI
|
Flavor:MutatingOperator |
Logically ANDs another BigInteger with this one
rhs | The value for the right hand side of this operation |
BI ← and BI BI
|
Flavor:MutatingOperator |
Multiplies another BigInteger with this one.
rhs | The value for the right hand side of this operation |
BI ← mul BI BI
|
Flavor:Operator |
Positates this BigInteger
BI ← pos BI
|
Flavor:Operator |
Increments this BigInteger (prefix)
BI ← incpre BI
|
Flavor:Operator |
Increments this BigInteger (postfix)
BI ← incpst BI
|
Flavor:MutatingOperator |
Adds another BigInteger to this one.
rhs | The value for the right hand side of this operation |
BI ← add BI BI
|
Flavor:Operator |
Negates this BigInteger
BI ← neg BI
|
Flavor:Operator |
Decrements this BigInteger (prefix)
BI ← decpre BI
|
Flavor:Operator |
Decrements this BigInteger (postfix)
BI ← decpst BI
|
Flavor:MutatingOperator |
Subtracts another BigInteger from this one.
rhs | The value for the right hand side of this operation |
BI ← sub BI BI
|
Flavor:MutatingOperator |
Divides this value by another BigInteger.
rhs | The value for the right hand side of this operation |
BI ← div BI BI
|
Flavor:MutatingOperator |
Divides this value by another number.
rhs | The value for the right hand side of this operation |
BI ← div BI U4
|
Flavor:MutatingOperator |
Divides this value by another number.
rhs | The value for the right hand side of this operation |
BI ← div BI U8
|
Flavor:MutatingOperator |
Shifts this value left by the given number of bits
shift | The number of bits by which to shift the value |
BI ← shl BI I4
|
Flavor:MutatingOperator |
Assigns from a bool
from | The value to assign from |
BI ← bi B
|
Flavor:MutatingOperator |
Assigns from a double
from | The value to assign from |
BI ← bi F8
|
Flavor:MutatingOperator |
Assigns from a float
from | The value to assign from |
BI ← bi F4
|
Flavor:MutatingOperator |
Assigns from an int16
from | The value to assign from |
BI ← bi I2
|
Flavor:MutatingOperator |
Assigns from a int32
from | The value to assign from |
BI ← bi I4
|
Flavor:MutatingOperator |
Assigns from a int64
from | The value to assign from |
BI ← bi I8
|
Flavor:MutatingOperator |
Assigns from an int8
from | The value to assign from |
BI ← bi I1
|
Flavor:MutatingOperator |
Assigns from a uint16
from | The value to assign from |
BI ← bi U2
|
Flavor:MutatingOperator |
Assigns from a uint32
from | The value to assign from |
BI ← bi U4
|
Flavor:MutatingOperator |
Assigns from a uint64
from | The value to assign from |
BI ← bi U8
|
Flavor:MutatingOperator |
Assigns from a uint8
from | The value to assign from |
BI ← bi U1
|
Flavor:MutatingOperator |
Shifts this value right by the given number of bits
shift | The number of bits by which to shift the value |
BI ← shr BI I4
|
Flavor:MutatingOperator |
Logically XORs another BigInteger with this one
rhs | The value for the right hand side of this operation |
BI ← xor BI BI
|
Flavor:MutatingOperator |
Logically ORs another BigInteger with this one
rhs | The value for the right hand side of this operation |
BI ← or BI BI
|
Flavor:Operator |
Performs bitwise inversion on this BigInteger
BI ← inv BI
|
staticFlavor:Static |
Logically ORs lhs and rhs and returns the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← or BI BI
|
Flavor:Instance |
Logically ORs this number with rhs and returns the result
rhs | The value for the right hand side of this operation |
BI ← or BI BI
|
Flavor:Mutating |
Logically ORs another BigInteger with this one, overwriting this instance with the result.
rhs | The value for the right hand side of this operation |
0 ← or BI BI
|
Flavor:Instance |
Gets the count of set bits on the number
I4 ← pop BI
|
staticFlavor:Static |
Gets the count of set bits on value
value | The number for which to get the bit count |
I4 ← pop BI
|
staticFlavor:Static |
Computes the result of raising the given base to the given exponent
base | The base number to be raised to a poower |
exponent | The power to raise the number to |
BI ← pow BI F4
|
staticFlavor:Static |
Computes the result of raising the given base to the given exponent
base | The base number to be raised to a poower |
exponent | The power to raise the number to |
BI ← pow BI I4
|
Flavor:Instance |
Computes the result of raising the number to the given exponent
exponent | The power to raise the number to |
BI ← pow BI F4
|
staticFlavor:Static |
Computes the result of raising the given base to the given exponent
base | The base number to be raised to a poower |
exponent | The power to raise the number to |
BI ← pow I4 I4
|
Flavor:Instance |
Computes the result of raising the number to the given exponent
exponent | The power to raise the number to |
BI ← pow BI I4
|
staticFlavor:Static |
Divides lhs by rhs and returns the remainder as the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← rem BI BI
|
staticFlavor:Static |
Divides lhs by rhs and returns the remainder as the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
U4 ← rem BI U4
|
staticFlavor:Static |
Divides lhs by rhs and returns the remainder as the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
U8 ← rem BI U8
|
Flavor:Instance |
Divides this number by rhs and returns the remainder as the result
rhs | The value for the right hand side of this operation |
BI ← rem BI BI
|
Flavor:Instance |
Divides this number by rhs and returns the remainder as the result
rhs | The value for the right hand side of this operation |
U4 ← rem BI U4
|
Flavor:Instance |
Divides this number by rhs and returns the remainder as the result
rhs | The value for the right hand side of this operation |
U8 ← rem BI U8
|
staticFlavor:Static |
Returns the whenTrue parameter when condition is true. Otherwise returns whenFalse.
whenTrue | The value to return when condition is true |
whenFalse | The value to return when condition is false |
condition | The condition that determines which value is returned. |
BI ← sel BI BI B
|
Flavor:Mutating |
Either keeps the current value of this, or chooses a new value for this based on condition If condition is false, the value of this is set to rhs. Otherwise, this is unmodified.
rhs | The number to apply if which is false |
condition | If true, the current value of this is kept. Otherwise the value of this is replaced with the value of rhs. |
0 ← sel BI BI B
|
staticFlavor:Static |
Returns a new number copied from value, with the specified bit set
value | The value to copy and modify |
bitIndex | The index of the bit to modify |
BI ← setbit BI I4
|
Flavor:Instance |
Returns a new number with the specified bit set
bitIndex | The index of the bit to modify |
BI ← setbit BI I4
|
Flavor:Mutating |
Sets the specified bit in this number
bitIndex | The index of the bit to modify |
0 ← setbit BI I4
|
Flavor:Instance |
Copies this number and sets the sign of the copy based the value of isNegative. If the value of the number is zero, this will have no effect.
isNegative | True if the resulting value should be negative. |
BI ← setsgn BI B
|
staticFlavor:Static |
Copies value and sets the sign of the copy based the value of isNegative. If the value of the number is zero, this will have no effect.
value | The number to be operated on |
isNegative | True if the resulting value should be negative. |
BI ← setsgn BI B
|
Flavor:Mutating |
Sets the sign of this number based the value of isNegative. If the value of the number is zero, this will have no effect.
isNegative | True if the resulting value should be negative. |
0 ← setsgn BI B
|
Flavor:Mutating |
Sets the value of this number to a bool value
value | The value to set the number to |
0 ← bi B
|
Flavor:Mutating |
Sets the value of this number to another BigInteger
value | The value to set the number to |
0 ← bi BI
|
Flavor:Mutating |
Sets the value of this number from the given magnitude and sign
magnitude | The magnitude to which to set the number |
isNegative | If true, the resulting value will be negative. Otherwise the value will be positive. |
0 ← bi U4[] B
|
Flavor:Mutating |
Sets the value of this number from an array of bytes
value | The value to set the number to |
0 ← bi U4[]
|
Flavor:Mutating |
Sets the value of this number from the given magnitude and sign
magnitude | The magnitude to which to set the number |
isNegative | If true, the resulting value will be negative. Otherwise the value will be positive. |
0 ← bi U1[] B
|
Flavor:Mutating |
Sets the value of this number from an array of bytes
value | The value to set the number to |
0 ← bi U1[]
|
Flavor:Mutating |
Sets the value of this number to a double value
value | The value to set the number to |
0 ← bi F8
|
Flavor:Mutating |
Sets the value of this number to a float value
value | The value to set the number to |
0 ← bi F4
|
Flavor:Mutating |
Sets the value of this number to an int16 value
value | The value to set the number to |
0 ← bi I2
|
Flavor:Mutating |
Sets the value of this number to an int32 value
value | The value to set the number to |
0 ← bi I4
|
Flavor:Mutating |
Sets the value of this number to an int64 value
value | The value to set the number to |
0 ← bi I8
|
Flavor:Mutating |
Sets the value of this number to an int8 value
value | The value to set the number to |
0 ← bi I1
|
Flavor:Mutating |
Sets the value of this number to a uint16 value
value | The value to set the number to |
0 ← bi U2
|
Flavor:Mutating |
Sets the value of this number to a uint32 value
value | The value to set the number to |
0 ← bi U4
|
Flavor:Mutating |
Sets the value of this number to a uint64 value
value | The value to set the number to |
0 ← bi U8
|
Flavor:Mutating |
Sets the value of this number to a uint8 value
value | The value to set the number to |
0 ← bi U1
|
staticFlavor:Static |
Sets the 32-bit word at the given index to the given word on a copy of value.
value | The value to copy and modify |
index | The index of the word to set |
word | the word to set into the copy of value |
BI ← setwrd BI I4 U4
|
Flavor:Instance |
Sets the 32-bit word at the given index to the given word on a copy of this number.
index | The index of the word to set |
word | the word to set into the copied value |
BI ← setwrd BI I4 U4
|
Flavor:Mutating |
Sets the 32-bit word at the given index to the given value.
index | The index of the word to set |
word | the word to set into this |
0 ← setwrd BI I4 U4
|
staticFlavor:Static |
Copies value and bitwise shifts the copy left by shift number of bits before returning it.
value | The value to shift |
shift | The number of bits by which to shift the value |
BI ← shl BI I4
|
Flavor:Instance |
Copies this number and bitwise shifts the copy left by shift number of bits before returning it.
shift | The number of bits by which to shift the copied value |
BI ← shl BI I4
|
Flavor:Mutating |
Shifts this value left by shift number of bits.
shift | The number of bits by which to shift the value |
0 ← shl BI I4
|
staticFlavor:Static |
Copies value and bitwise shifts the copy right by shift number of bits before returning it.
value | The value to shift |
shift | The number of bits by which to shift the value |
BI ← shr BI I4
|
Flavor:Instance |
Copies this number and bitwise shifts the copy right by shift number of bits before returning it.
shift | The number of bits by which to shift the copiied value |
BI ← shr BI I4
|
Flavor:Mutating |
Shifts this value right by shift number of bits.
shift | The number of bits by which to shift the value |
0 ← shr BI I4
|
Flavor:Instance |
Computes the square root of the number
BI ← sqrt BI
|
staticFlavor:Static |
Computes the square root of the number
value | The number to take the square root of |
BI ← sqrt BI
|
staticFlavor:Static |
Subtracts rhs from lhs returns the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← sub BI BI
|
Flavor:Instance |
Subtracts another value from this one and returns the result
rhs | The value for the right hand side of this operation |
BI ← sub BI BI
|
Flavor:Mutating |
Subtracts another BigInteger from this one, overwriting this instance with the result.
rhs | The value for the right hand side of this operation |
0 ← sub BI BI
|
staticFlavor:Static |
Returns a new number copied from value, with the specified bit toggled
value | The value to copy and modify |
bitIndex | The index of the bit to modify |
BI ← togbit BI I4
|
Flavor:Instance |
Returns a new number with the specified bit toggled
bitIndex | The index of the bit to modify |
BI ← togbit BI I4
|
Flavor:Mutating |
Toggles the specified bit in this number
bitIndex | The index of the bit to modify |
0 ← togbit BI I4
|
Flavor:Instance |
Converts this number to a hexadecimal string, without applying any formatting.
S ← strh BI
|
Flavor:Instance |
Converts this number to a decimal string, without applying any formatting.
S ← strd BI
|
staticFlavor:Static |
Logically XORs lhs and rhs and returns the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← xor BI BI
|
Flavor:Instance |
Logically XORs this number with rhs and returns the result
rhs | The value for the right hand side of this operation |
BI ← xor BI BI
|
Flavor:Mutating |
Logically XORs another BigInteger with this one, overwriting this instance with the result.
rhs | The value for the right hand side of this operation |
0 ← xor BI BI
|
friendFlavor:Operator |
Compares two values to see if they are not equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← neq BI BI
|
friendFlavor:Operator |
Compares two values to see if they are not equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← neq BI I4
|
friendFlavor:Operator |
Compares two values to see if they are not equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← neq BI I8
|
friendFlavor:Operator |
Compares two values to see if they are not equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← neq BI U4
|
friendFlavor:Operator |
Compares two values to see if they are not equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← neq BI U8
|
friendFlavor:Operator |
Compares two values to see if they are not equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← neq I4 BI
|
friendFlavor:Operator |
Compares two values to see if they are not equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← neq I8 BI
|
friendFlavor:Operator |
Compares two values to see if they are not equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← neq U4 BI
|
friendFlavor:Operator |
Compares two values to see if they are not equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← neq U8 BI
|
friendFlavor:Operator |
Divides lhs by rhs and returns the remainder as the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← rem BI BI
|
friendFlavor:Operator |
Divides lhs by rhs and returns the remainder as the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← rem BI U4
|
friendFlavor:Operator |
Divides lhs by rhs and returns the remainder as the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← rem BI U8
|
friendFlavor:Operator |
Logically ANDs lhs and rhs and returns the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← and BI BI
|
friendFlavor:Operator |
Multiplies the two values and returns the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← mul BI BI
|
friendFlavor:Operator |
Adds the two values and returns the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← add BI BI
|
friendFlavor:Operator |
Subtracts rhs from lhs returns the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← sub BI BI
|
friendFlavor:Operator |
Divides lhs by rhs and returns the quotient as the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← div BI BI
|
friendFlavor:Operator |
Divides lhs by rhs and returns the quotient as the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← div BI U4
|
friendFlavor:Operator |
Divides lhs by rhs and returns the quotient as the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← div BI U8
|
friendFlavor:Operator |
Compares two values to see if the left value is less than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lt BI BI
|
friendFlavor:Operator |
Compares two values to see if the left value is less than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lt BI I4
|
friendFlavor:Operator |
Compares two values to see if the left value is less than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lt BI I8
|
friendFlavor:Operator |
Compares two values to see if the left value is less than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lt BI U4
|
friendFlavor:Operator |
Compares two values to see if the left value is less than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lt BI U8
|
friendFlavor:Operator |
Compares two values to see if the left value is less than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lt I4 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is less than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lt I8 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is less than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lt U4 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is less than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lt U8 BI
|
friendFlavor:Operator |
Shifts lhs left by the given number of bits
lhs | The value to be shifted |
shift | The number of bits by which to shift the value |
BI ← shl BI BI
|
friendFlavor:Operator |
Compares two values to see if the left value is less than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lteq BI BI
|
friendFlavor:Operator |
Compares two values to see if the left value is less than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lteq BI I4
|
friendFlavor:Operator |
Compares two values to see if the left value is less than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lteq BI I8
|
friendFlavor:Operator |
Compares two values to see if the left value is less than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lteq BI U4
|
friendFlavor:Operator |
Compares two values to see if the left value is less than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lteq BI U8
|
friendFlavor:Operator |
Compares two values to see if the left value is less than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lteq I4 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is less than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lteq I8 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is less than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lteq U4 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is less than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← lteq U8 BI
|
friendFlavor:Operator |
Compares two values to see if they are equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← eq BI BI
|
friendFlavor:Operator |
Compares two values to see if they are equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← eq BI I4
|
friendFlavor:Operator |
Compares two values to see if they are equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← eq BI I8
|
friendFlavor:Operator |
Compares two values to see if they are equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← eq BI U4
|
friendFlavor:Operator |
Compares two values to see if they are equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← eq BI U8
|
friendFlavor:Operator |
Compares two values to see if they are equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← eq I4 BI
|
friendFlavor:Operator |
Compares two values to see if they are equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← eq I8 BI
|
friendFlavor:Operator |
Compares two values to see if they are equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← eq U4 BI
|
friendFlavor:Operator |
Compares two values to see if they are equal
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← eq U8 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gt BI BI
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gt BI I4
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gt BI I8
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gt BI U4
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gt BI U8
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gt I4 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gt I8 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gt U4 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gt U8 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gteq BI BI
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gteq BI I4
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gteq BI I8
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gteq BI U4
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gteq BI U8
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gteq I4 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gteq I8 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gteq U4 BI
|
friendFlavor:Operator |
Compares two values to see if the left value is greater than or equal to the right value
lhs | The left hand value to compare |
rhs | The right hand value to compare |
B ← gteq U8 BI
|
friendFlavor:Operator |
Shifts lhs right by the given number of bits
lhs | The value to be shifted |
shift | The number of bits by which to shift the value |
BI ← shr BI BI
|
friendFlavor:Operator |
Logically XORs lhs and rhs and returns the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← xor BI BI
|
friendFlavor:Operator |
Logically ORs lhs and rhs and returns the result
lhs | The value for the left hand side of this operation |
rhs | The value for the right hand side of this operation |
BI ← or BI BI
|
staticFlavor:Static |
The value representing minus one
BI ← neg1 0
|
staticFlavor:Static |
The value representing one
BI ← one 0
|
staticFlavor:Static |
The value representing zero
BI ← zero 0