Haskell

Timon Gehr timon.gehr at gmx.ch
Wed Aug 24 19:24:33 PDT 2011


On 08/25/2011 04:11 AM, bearophile wrote:
> 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

Ah, it is the format string that is not standard as well, now I get it.
I'll give it a try tomorrow, thanks!


More information about the Digitalmars-d mailing list