The OpenD Programming Language

BigInt.toString

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

  1. void toString(Writer sink, string formatString)
  2. void toString(Writer sink, FormatSpec!char f)
  3. void toString(void delegate(scope const(char)[]) sink, string formatString)
  4. void toString(void delegate(scope const(char)[]) sink, FormatSpec!char f)
    struct BigInt
    const
    void
    toString
    (
    scope void delegate
    (
    scope const(char)[]
    )
    sink
    ,
    scope const ref FormatSpec!char f
    )

Parameters

sink void delegate
(
scope const(char)[]
)

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