BigUIntView.toStringImpl

struct BigUIntView(W, WordEndian endian = TargetEndian)
@safe pure nothrow @nogc
static if(isMutable!W && W.sizeof >= 4)
size_t
toStringImpl
(
C
)
(
scope C[] str
)
if (
isSomeChar!C &&
isMutable!C
)
if (
__traits(isUnsigned, W)
)

Parameters

str C[]

string buffer, the tail paer Precondition: mutable number with word size at least 4 bytes Postconditoin: the number is destroyed

Return Value

Type: size_t

last N bytes used in the buffer

Examples

import mir.bignum.integer;

auto a = BigInt!2("123456789098765432123456789098765432100");
char[ceilLog10Exp2(a.data.length * (size_t.sizeof * 8))] buffer;
auto len = a.view.unsigned.toStringImpl(buffer);
assert(buffer[$ - len .. $] == "123456789098765432123456789098765432100");

Meta