[Issue 7155] New: inconsistent .stringof

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 22 10:59:59 PST 2011


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

           Summary: inconsistent .stringof
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: timon.gehr at gmx.ch


--- Comment #0 from timon.gehr at gmx.ch 2011-12-22 10:59:57 PST ---
For example, all of those fail:
static assert(100001f.stringof     == "100001f");
static assert(1000001f.stringof    == "1000001f");
static assert([100001f].stringof   == "[100001f]");
static assert([1000001f].stringof  == "[1000001f]");

static assert(100001.0.stringof    == "100001.0");
static assert(1000001.0.stringof   == "1000001.0");
static assert([100001.0].stringof  == "[100001.0]");
static assert([1000001.0].stringof == "[1000001.0]");

static assert(TypeTuple!(int, 1).stringof == "(int, 1)");

currently:

100001f.stringof     == "100001",
1000001f.stringof    == "1e+06
[100001f].stringof   == "[100001F]"
[1000001f].stringof  == "[0xf.4241p+16F]"

100001.0.stringof    == "100001"
1000001.0.stringof   == "1e+06"
[100001.0].stringof  == "[100001]"
[1000001.0].stringof == "[0xf.4241p+16]"

TypeTuple!(int,double).stringof == "(int, double)" // fine
TypeTuple!(int, 1).stringof == "tuple((int),1)"    // oO ?

Preferably the constants should all be represented in decimal but in a way that
preserves their value when mixed in at another place. (with the minimum number
of digits)

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


More information about the Digitalmars-d-bugs mailing list