http://d.puremagic.com/issues/show_bug.cgi?id=5970


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugd...@yahoo.com.au


--- Comment #3 from Don <clugd...@yahoo.com.au> 2011-08-25 01:27:40 PDT ---
(In reply to comment #0)
> This is in reply to comment #3 of bug 5765
> 
> > > How do I perform the equivalent of str(ackermann(4, 2)) with BigInt?
> > 
> > format("%d", ackermann(4,2))
> 
> I think it doesn't work with DMD 2.053beta:
> 
> 
> import std.bigint, std.string;
> void main() {
>     format("%d", BigInt(1));
> }
> 
> 
> It prints:
> std.format.FormatError: std.format Can't convert std.bigint.BigInt to string:
> "string toString()" not defined

You're right. writefln() works, but format() doesn't:

import std.bigint, std.stdio;
void main() {
    writefln("%d %x", BigInt(114), BigInt(114)); // works
}

A bit strange, since writefln() should really be using format().

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to