BigInt.toString

Convert the BigInt to string, passing it to the given sink.

Parameters

sink Writer

An OutputRange for accepting possibly piecewise segments of the formatted string.

Examples

toString is rarely directly invoked; the usual way of using it is via std.format.format:

import std.format : format;

auto x = BigInt("1_000_000");
x *= 12345;

assert(format("%d", x) == "12345000000");
assert(format("%x", x) == "2_dfd1c040");
assert(format("%X", x) == "2_DFD1C040");
assert(format("%o", x) == "133764340100");

Meta