Haskell

bearophile bearophileHUGS at lycos.com
Wed Aug 24 19:11:35 PDT 2011


Timon Geh:

> Done: http://pastebin.com/Vx4hXvaT
> 
> Theoretically it could use std.bigint, but I have still not found out 
> how to convert these to string without pain.

To compute Hamming(1_000_000) this converts a BigInt to string:

string bigIntRepr(BigInt i) {
    const(char)[] result;
    i.toString((const(char)[] s) { result = s; }, "d");
    return to!string(result);
}

Bye,
bearophile


More information about the Digitalmars-d mailing list