www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6627] New: BigInt textual representation

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6627

           Summary: BigInt textual representation
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



This is more than an enhancement request because I think this is a basic need.

With dmd 2.055 this code doesn't compile, but I hope it will eventually work:


import std.bigint, std.string, std.conv;
void main() {
    auto s1 = text(BigInt(1));
    auto s2 = format("%s", BigInt(1));
    auto s3 = format("%d", BigInt(1));
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 08 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6627




I have posted two pull requests.

https://github.com/D-Programming-Language/phobos/pull/236
to!SomeString should use formatValue. After that, std.conv.text() using to!()
will support BigInt implicitly.

https://github.com/D-Programming-Language/phobos/pull/231
Issue 6595 - std.string.format() and sformat() are obsolete
std.string.format() and sformat() are now uses std.format.doFormat(), but it is
obsolute function. After that, the two functions uses formatValue, and will
support BigInt implicitly.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 08 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6627


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



Fixed time ago.

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