std.internal.math.biguintcore

Fundamental operations for arbitrary-precision arithmetic

These functions are for internal use only.

Types 3

aliasmultibyteAdd = multibyteAddSub!('+')
aliasmultibyteSub = multibyteAddSub!('-')
structBigUint

BigUint performs memory management and wraps the low-level calls.

Methods
size_t uintLength() @property pure nothrow const @safe @nogc scope
size_t ulongLength() @property pure nothrow const @safe @nogc scope
ulong peekUlong(size_t n) pure nothrow const @safe @nogc scope
uint peekUint(size_t n) pure nothrow const @safe @nogc scope
void opAssign(Tulong)(Tulong u) if (is (Tulong == ulong)) pure nothrow @safe scope
void opAssign(Tdummy = void)(BigUint y) pure nothrow @nogc @safe scope
int opCmp(Tdummy = void)(const BigUint y) pure nothrow @nogc const @safe scope
int opCmp(Tulong)(Tulong y) if (is (Tulong == ulong)) pure nothrow @nogc const @safe scope
bool opEquals(Tdummy = void)(ref const BigUint y) pure nothrow @nogc const @safe scope
bool opEquals(Tdummy = void)(ulong y) pure nothrow @nogc const @safe scope
bool isZero() pure const nothrow @safe @nogc scope
size_t numBytes() pure nothrow const @safe @nogc scope
char [] toDecimalString(int frontExtraBytes) const pure nothrow @safe scope
char [] toHexString(int frontExtraBytes, char separator = 0, int minPadding = 0, char padChar = '0', LetterCase letterCase = LetterCase.upper) const pure nothrow @safe scopeConvert to a hex string, printing a minimum number of digits 'minPadding', allocating an additional 'frontExtraBytes' at the start of the string. Padding is done with padChar, which may be '0' or '...
char[] toOctalString() pure nothrow @safe const scopeConvert to an octal string.
bool fromHexString(Range)(Range s) if (isBidirectionalRange!Range && isSomeChar!(ElementType!Range)) scope
bool fromDecimalString(Range)(Range s) if (isForwardRange!Range && isSomeChar!(ElementType!Range)) scope
void fromMagnitude(Range)(Range magnitude) if (isInputRange!Range && (isForwardRange!Range || hasLength!Range) && isUnsigned!(ElementType!Range)) scope
BigUint opBinary(string op, Tulong)(Tulong y) if (op == ">>" && is (Tulong == ulong)) pure nothrow @safe const return scope
BigUint opBinary(string op, Tulong)(Tulong y) if (op == "<<" && is (Tulong == ulong)) pure nothrow @safe const scope
BigUint addOrSubInt(Tulong)(const scope BigUint x, Tulong y, bool wantSub, ref bool sign) if (is(Tulong == ulong)) static pure nothrow @safe
BigUint addOrSub(scope BigUint x, scope BigUint y, bool wantSub, ref bool sign) static pure nothrow @safe
BigUint mulInt(T = ulong)(BigUint x, T y) static pure nothrow @safe
BigUint mul(scope BigUint x, scope BigUint y) static pure nothrow @safe
BigUint divInt(T)(return scope BigUint x, T y_) if ( is(immutable T == immutable uint) ) static pure nothrow @safe
BigUint divInt(T)(scope BigUint x, T y) if ( is(immutable T == immutable ulong) ) static pure nothrow @safe
uint modInt(T)(scope BigUint x, T y_) if ( is(immutable T == immutable uint) ) static pure
BigUint div(return scope BigUint x, scope BigUint y) static pure nothrow @safe
BigUint mod(return scope BigUint x, scope BigUint y) static pure nothrow @safe
void divMod(BigUint x, scope BigUint y, out BigUint quotient, out BigUint remainder) static pure nothrow @safe
BigUint bitwiseOp(string op)(scope BigUint x, scope BigUint y, bool xSign, bool ySign, ref bool resultSign) if (op == "|" || op == "^" || op == "&") static pure nothrow @safe
BigUint pow(return scope BigUint x, ulong y) static pure nothrow @safeReturn a BigUint which is x raised to the power of y. Method: Powers of 2 are removed from x, then left-to-right binary exponentiation is used. Memory allocation is minimized: at most one temporary...
size_t toHash() const @nogc nothrow pure @safe scope
Constructors
this(return scope immutable(BigDigit) [] x)
this(T x)

Functions 1

fninout(BigDigit) [] removeLeadingZeros(return scope inout(BigDigit) [] x) pure nothrow @safe

Templates 1

tmplmaxBigDigits(T) if (isIntegral!T)