Duke's Big Numbers 1.0
C++ and Blueprint libraries for performing math, analysis, and formatting with really large numbers (>10e308).
|
#include "BigIntegerLibrary.h"
Provides Blueprint-capable API methods over top of BigInteger for BigInteger's core math functionality.
|
staticFlavor:Blueprint |
Returns the absolute (positive) value of In
In | The input value |
BI ← abs BI
|
staticFlavor:Blueprint |
Adds two BigInteger values
A | Addend |
B | Addend |
BI ← add BI BI
|
staticFlavor:Blueprint |
Bitwise ANDs two BigInteger values
A | Logicand |
B | Logicand |
BI ← and BI BI
|
staticFlavor:Blueprint |
Gets whether the number can be cast to a Double without loss of information
In | The number for which to determine if it can fit in the specified type |
B ← fitf8 BI
|
staticFlavor:Blueprint |
Gets whether the number can be cast to a Double without overflow, but while possibly losing precision
In | The number for which to determine if it can fit in the specified type |
B ← fitlf8 BI
|
staticFlavor:Blueprint |
Gets whether the number can be cast to a Float without loss of information
In | The number for which to determine if it can fit in the specified type |
B ← fitf4 BI
|
staticFlavor:Blueprint |
Gets whether the number can be cast to a Float without overflow, but while possibly losing precision
In | The number for which to determine if it can fit in the specified type |
B ← fitlf4 BI
|
staticFlavor:Blueprint |
Gets whether the number can be cast to an Integer64 without loss of information
In | The number for which to determine if it can fit in the specified type |
B ← fiti8 BI
|
staticFlavor:Blueprint |
Gets whether the number can be cast to an Integer without loss of information
In | The number for which to determine if it can fit in the specified type |
B ← fiti4 BI
|
staticFlavor:Blueprint |
Constrains 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
|
staticFlavor:Blueprint |
Clears the given Bit on Value
Value | The value to operate on |
Bit | The index of the bit to modify |
BI ← clrbit BI I4
|
staticFlavor:Blueprint |
Compares two numbers and provides the result as a standard three-way comparison value
A | The number for the left side of the comparison |
B | The number for the right side of the comparison |
I4 ← cmp BP BI
|
staticFlavor:Blueprint |
Compares two numbers and provides the result as a standard three-way comparison value
A | The number for the left side of the comparison |
B | The number for the right side of the comparison |
I4 ← cmp BI I4
|
staticFlavor:Blueprint |
Compares two numbers and provides the result as a standard three-way comparison value
A | The number for the left side of the comparison |
B | The number for the right side of the comparison |
I4 ← cmp BI I8
|
staticFlavor:Blueprint |
Compares two numbers and provides the result as a standard three-way comparison value
A | The number for the left side of the comparison |
B | The number for the right side of the comparison |
I4 ← cmp I8 BI
|
staticFlavor:Blueprint |
Compares two numbers and provides the result as a standard three-way comparison value
A | The number for the left side of the comparison |
B | The number for the right side of the comparison |
I4 ← cmp I4 BI
|
staticFlavor:Blueprint |
Compares two numbers and branches based on the result
A | The number for the left side of the comparison |
B | The number for the right side of the comparison |
U1 ← cex BI BI
|
staticFlavor:Blueprint |
Compares two numbers and branches based on the result
A | The number for the left side of the comparison |
B | The number for the right side of the comparison |
U1 ← cex BI I4
|
staticFlavor:Blueprint |
Compares two numbers and branches based on the result
A | The number for the left side of the comparison |
B | The number for the right side of the comparison |
U1 ← cex BI I8
|
staticFlavor:Blueprint |
Compares two numbers and branches based on the result
A | The number for the left side of the comparison |
B | The number for the right side of the comparison |
U1 ← cex I8 BI
|
staticFlavor:Blueprint |
Compares two numbers and branches based on the result
A | The number for the left side of the comparison |
B | The number for the right side of the comparison |
U1 ← cex I4 BI
|
staticFlavor:Blueprint |
Compares the magnitude of two numbers and branches based on the result
A | The number for the left side of the comparison |
B | The number for the right side of the comparison |
U1 ← cexmag BI BI
|
staticFlavor:Blueprint |
Compares the magnitude of two numbers disregarding sign, and provides the result as a standard three-way comparison value
A | The number for the left side of the comparison |
B | The number for the right side of the comparison |
I4 ← cmpmag BP BI
|
staticFlavor:Blueprint |
Converts a BigInteger to a Boolean
In | The value to be converted |
B ← b BI
|
staticFlavor:Blueprint |
Converts a BigInteger to a Byte
In | The value to be converted |
U1 ← u1 BI
|
staticFlavor:Blueprint |
Converts a BigInteger to an Array of Byte
In | The value to be converted |
U1[] ← u1arr BI
|
staticFlavor:Blueprint |
Converts a BigInteger to a Double
In | The value to be converted |
F8 ← f8 BI
|
staticFlavor:Blueprint |
Converts a BigInteger to a Float
In | The value to be converted |
F4 ← f4 BI
|
staticFlavor:Blueprint |
Converts a BigInteger to an Integer
In | The value to be converted |
I4 ← i4 BI
|
staticFlavor:Blueprint |
Converts a BigInteger to an Integer64
In | The value to be converted |
I8 ← i8 BI
|
staticFlavor:Blueprint |
Converts a Boolean to a BigInteger
In | The value to be converted |
BI ← bi B
|
staticFlavor:Blueprint |
Converts an Array of Byte to a BigInteger
In | The value to be converted |
BI ← bi U1[]
|
staticFlavor:Blueprint |
Converts a Byte to a BigInteger
In | The value to be converted |
BI ← bi U1
|
staticFlavor:Blueprint |
Converts a Double to a BigInteger
In | The value to be converted |
BI ← bi F8
|
staticFlavor:Blueprint |
Converts a Float to a BigInteger
In | The value to be converted |
BI ← bi F4
|
staticFlavor:Blueprint |
Converts an Integer64 to a BigInteger
In | The value to be converted |
BI ← bi I8
|
staticFlavor:Blueprint |
Converts an Integer to a BigInteger
In | The value to be converted |
BI ← bi I4
|
staticFlavor:Blueprint |
Takes the magnitude of A and writes the sign from B to it.
A | The number that contributes the magnitude of the result |
B | The number that contributes the sign of the result |
BI ← cpysgn BI BI
|
staticFlavor:Blueprint |
Gets the count of set bits on the number
Value | The value to get the count of set from |
I4 ← pop BI
|
staticFlavor:Blueprint |
Gets the count of leading zero bits on the uppermost 32-bit word of the number
Value | The value to get the count of leading zero bits from |
I4 ← nlz BI
|
staticFlavor:Blueprint |
Gets the count of precision bits used in the number
Value | The value to get the count of precision bits from |
I4 ← prec BI
|
staticFlavor:Blueprint |
Gets the count of trailing zero bits on the number
Value | The value to get the count of trailing zero bits from |
I4 ← ntz BI
|
staticFlavor:Blueprint |
Subtracts 1 to the specified value and then set it
In | The value to be decremented |
BI ← decpre BI
|
staticFlavor:Blueprint |
Divides two BigInteger values and returns the quotient
A | Dividend |
B | Divisor |
BI ← div BI BI
|
staticFlavor:Blueprint |
Divides two BigInteger values and outputs the quotient and remainder
A | Dividend |
B | Divisor |
Quotient | The quotient from dividing the numbers |
Remainder | The remainder from dividing the numbers |
BI ← divrem BI BI BI&
|
staticFlavor:Blueprint |
Returns true if A is equal to B (A == B)
A | Value to compare |
B | Value to compare |
B ← eq BI BI
|
staticFlavor:Blueprint |
Returns true if A is equal to B (A == B)
A | Value to compare |
B | Value to compare |
B ← eq BI I4
|
staticFlavor:Blueprint |
Returns true if A is equal to B (A == B)
A | Value to compare |
B | Value to compare |
B ← eq BI I8
|
staticFlavor:Blueprint |
Returns true if A is equal to B (A == B)
A | Value to compare |
B | Value to compare |
B ← eq I8 BI
|
staticFlavor:Blueprint |
Returns true if A is equal to B (A == B)
A | Value to compare |
B | Value to compare |
B ← eq I4 BI
|
staticFlavor:Blueprint |
Returns the floor of the base 10 logarithm of In
In | The input value |
I4 ← flog10 BI
|
staticFlavor:Blueprint |
Returns the floor of the base 2 logarithm of In
In | The input value |
I4 ← flog2 BI
|
staticFlavor:Blueprint |
Gets the greatest common divisor (GCD) between two numbers.
A | The number for which to calculate GCD |
B | The number for which to calculate GCD |
BI ← gcd BI BI
|
staticFlavor:Blueprint |
Extracts the bit at the given bit position
Value | The value to get the bit from |
Position | The position of the bit to extract |
I4 ← bit BI
|
staticFlavor:Blueprint |
Gets the sign of the number
Value | The value to get the sign from |
I4 ← sgn BI
|
staticFlavor:Blueprint |
Gets the bit length needed to hold the number in twos complement format.
Value | The value to get the bit length of the number from |
I4 ← sblen BI
|
staticFlavor:Blueprint |
Gets the byte length needed to hold the number in twos complement format.
Value | The value to get the byte length of the number from |
I4 ← su1len BI
|
staticFlavor:Blueprint |
Gets the number of 32 bit words needed to hold the number in twos complement format.
Value | The value to get the length of the number from |
I4 ← su4len BI
|
staticFlavor:Blueprint |
Gets the length of the number in 32-bit unsigned words, not accounting for sign
Value | The value to get the length of the number from |
I4 ← uu4len BI
|
staticFlavor:Blueprint |
Returns true if A is greater than B (A > B)
A | Value to compare |
B | Value to compare |
B ← gt BI BI
|
staticFlavor:Blueprint |
Returns true if A is greater than B (A > B)
A | Value to compare |
B | Value to compare |
B ← gt BI I4
|
staticFlavor:Blueprint |
Returns true if A is greater than B (A > B)
A | Value to compare |
B | Value to compare |
B ← gt BI I8
|
staticFlavor:Blueprint |
Returns true if A is greater than B (A > B)
A | Value to compare |
B | Value to compare |
B ← gt I8 BI
|
staticFlavor:Blueprint |
Returns true if A is greater than B (A > B)
A | Value to compare |
B | Value to compare |
B ← gt I4 BI
|
staticFlavor:Blueprint |
Returns true if A is greater than or equal to B (A >= B)
A | Value to compare |
B | Value to compare |
B ← gteq BI BI
|
staticFlavor:Blueprint |
Returns true if A is greater than or equal to B (A >= B)
A | Value to compare |
B | Value to compare |
B ← gteq BI I4
|
staticFlavor:Blueprint |
Returns true if A is greater than or equal to B (A >= B)
A | Value to compare |
B | Value to compare |
B ← gteq BI I8
|
staticFlavor:Blueprint |
Returns true if A is greater than or equal to B (A >= B)
A | Value to compare |
B | Value to compare |
B ← gteq I8 BI
|
staticFlavor:Blueprint |
Returns true if A is greater than or equal to B (A >= B)
A | Value to compare |
B | Value to compare |
B ← gteq I4 BI
|
staticFlavor:Blueprint |
Add 1 to the specified value and then set it
In | The value to be incremented |
BI ← incpre BI
|
staticFlavor:Blueprint |
Bitwise inverts the value
In | The value to be inverted |
BI ← inv BI
|
staticFlavor:Blueprint |
Returns true if the value is even, otherwise returns false
In | The value to be checked |
B ← iseven BI
|
staticFlavor:Blueprint |
Returns true if the value is negative one, otherwise returns false
In | The value to be checked |
B ← isneg1 BI
|
staticFlavor:Blueprint |
Returns true if the value is less than zero, otherwise returns false
In | The value to be checked |
B ← isneg BI
|
staticFlavor:Blueprint |
Returns true if the value is odd, otherwise returns false
In | The value to be checked |
B ← isodd BI
|
staticFlavor:Blueprint |
Returns true if the value is one, otherwise returns false
In | The value to be checked |
B ← isone BI
|
staticFlavor:Blueprint |
Returns true if the value is greater than zero, otherwise returns false
In | The value to be checked |
B ← ispos BI
|
staticFlavor:Blueprint |
Returns true if the value is a power of two, otherwise returns false
In | The value to be checked |
B ← ispot BI
|
staticFlavor:Blueprint |
Returns true if the value is zero, otherwise returns false
In | The value to be checked |
B ← iszero BI
|
staticFlavor:Blueprint |
Returns true if A is less than B (A < B)
A | Value to compare |
B | Value to compare |
B ← lt BI BI
|
staticFlavor:Blueprint |
Returns true if A is less than B (A < B)
A | Value to compare |
B | Value to compare |
B ← lt BI I4
|
staticFlavor:Blueprint |
Returns true if A is less than B (A < B)
A | Value to compare |
B | Value to compare |
B ← lt BI I8
|
staticFlavor:Blueprint |
Returns true if A is less than B (A < B)
A | Value to compare |
B | Value to compare |
B ← lt I8 BI
|
staticFlavor:Blueprint |
Returns true if A is less than B (A < B)
A | Value to compare |
B | Value to compare |
B ← lt I4 BI
|
staticFlavor:Blueprint |
Returns true if A is less than or equal to B (A <= B)
A | Value to compare |
B | Value to compare |
B ← lteq BI BI
|
staticFlavor:Blueprint |
Returns true if A is less than or equal to B (A <= B)
A | Value to compare |
B | Value to compare |
B ← lteq BI I4
|
staticFlavor:Blueprint |
Returns true if A is less than or equal to B (A <= B)
A | Value to compare |
B | Value to compare |
B ← lteq BI I8
|
staticFlavor:Blueprint |
Returns true if A is less than or equal to B (A <= B)
A | Value to compare |
B | Value to compare |
B ← lteq I8 BI
|
staticFlavor:Blueprint |
Returns true if A is less than or equal to B (A <= B)
A | Value to compare |
B | Value to compare |
B ← lteq I4 BI
|
staticFlavor:Blueprint |
Returns the base 10 logarithm of In as a Float
In | The input value |
F4 ← log10 BI
|
staticFlavor:Blueprint |
Returns the base 10 logarithm of In as a Double
In | The input value |
F8 ← log10d BI
|
staticFlavor:Blueprint |
Returns the base 2 logarithm of In as a Float
In | The input value |
F4 ← log2 BI
|
staticFlavor:Blueprint |
Returns the base 2 logarithm of In as a Double
In | The input value |
F8 ← log2d BI
|
staticFlavor:Blueprint |
Returns the base Base logarithm of In as a Double
In | The input value |
Base | The base of the logarithm to compute |
F8 ← log BI F8
|
staticFlavor:Blueprint |
Returns the base Base logarithm of In as a Float
In | The input value |
Base | The base of the logarithm to compute |
F4 ← log BI F4
|
staticFlavor:Blueprint |
Returns the base e logarithm of In as a Float
In | The input value |
F4 ← loge BI
|
staticFlavor:Blueprint |
Returns the base e logarithm of In as a Double
In | The input value |
F8 ← loged BI
|
staticFlavor:Blueprint |
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. |
BI ← bi U1[] B
|
staticFlavor:Blueprint |
Returns the greater of two values
A | Value to compare |
B | Value to compare |
BI ← max BI BI
|
staticFlavor:Blueprint |
Returns the value with the greater absolute magnitude
A | Value to compare |
B | Value to compare |
BI ← maxmag BI BI
|
staticFlavor:Blueprint |
Returns the lesser of two values
A | Value to compare |
B | Value to compare |
BI ← min BI BI
|
staticFlavor:Blueprint |
Returns the value with the lesser absolute magnitude
A | Value to compare |
B | Value to compare |
BI ← minmag BI BI
|
staticFlavor:Blueprint |
Represents negative one as a BigInteger
BI ← neg1 0
|
staticFlavor:Blueprint |
Multiplies two BigInteger values
A | Multiplicand |
B | Multiplicand |
BI ← mul BI BI
|
staticFlavor:Blueprint |
Returns the negative absolute value of In
In | The input value |
BI ← nabs BI
|
staticFlavor:Blueprint |
Returns the negative value of In
In | The input value |
BI ← neg BI
|
staticFlavor:Blueprint |
Logically inverts the value
In | The value to be inverted |
B ← not BI
|
staticFlavor:Blueprint |
Returns true if A is not equal to B (A != B)
A | Value to compare |
B | Value to compare |
B ← neq BI BI
|
staticFlavor:Blueprint |
Returns true if A is not equal to B (A != B)
A | Value to compare |
B | Value to compare |
B ← neq BI I4
|
staticFlavor:Blueprint |
Returns true if A is not equal to B (A != B)
A | Value to compare |
B | Value to compare |
B ← neq BI I8
|
staticFlavor:Blueprint |
Returns true if A is not equal to B (A != B)
A | Value to compare |
B | Value to compare |
B ← neq I8 BI
|
staticFlavor:Blueprint |
Returns true if A is not equal to B (A != B)
A | Value to compare |
B | Value to compare |
B ← neq I4 BI
|
staticFlavor:Blueprint |
Represents One as a BigInteger
BI ← one 0
|
staticFlavor:Blueprint |
Bitwise ORs two BigInteger values
A | Logicand |
B | Logicand |
BI ← or BI BI
|
staticFlavor:Blueprint |
Raises a BigInteger to a power
Base | The number to be raised to a power |
Exponent | The exponent to raise the number to |
BI ← pow BI F4
|
staticFlavor:Blueprint |
Raises a BigInteger to a power
Base | The number to be raised to a power |
Exponent | The exponent to raise the number to |
BI ← pow BI I4
|
staticFlavor:Blueprint |
Raises a BigInteger to a float power
Base | The number to be raised to a power |
Exponent | The exponent to raise the number to |
BI ← pow I4 I4
|
staticFlavor:Blueprint |
Divides two BigInteger values and returns the remainder
A | Dividend |
B | Divisor |
BI ← rem BI BI
|
staticFlavor:Blueprint |
Returns WhenTrue 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
|
staticFlavor:Blueprint |
Sets the given Bit on Value
Value | The value to operate on |
Bit | The index of the bit to modify |
BI ← setbit BI I4
|
staticFlavor:Blueprint |
Returns In with the sign set per IsNegative
In | The input value |
IsNegative | Whether the new value should be negative |
BI ← setsgn BI B
|
staticFlavor:Blueprint |
Shifts the value left by the specified number of bits
In | The value to be shifted |
Shift | The number of bits by which to shift the value |
BI ← shl BI I4
|
staticFlavor:Blueprint |
Shifts the value left by the specified number of bits
In | The value to be shifted |
Shift | The number of bits by which to shift the value |
BI ← shr BI I4
|
staticFlavor:Blueprint |
Returns the square root of In
In | The input value |
BI ← sqrt BI
|
staticFlavor:Blueprint |
Subtracts one BigInteger value from another
A | Number to be subtracted from |
B | Number to be subtracted |
BI ← sub BI BI
|
staticFlavor:Blueprint |
Toggles the given Bit on Value
Value | The value to operate on |
Bit | The index of the bit to modify |
BI ← togbit BI I4
|
staticFlavor:Blueprint |
Bitwise XORs two BigInteger values
A | Logicand |
B | Logicand |
BI ← xor BI BI
|
staticFlavor:Blueprint |
Represents Zero as a BigInteger
BI ← zero 0