Bug 7155 – inconsistent .stringof

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-12-22T10:59:57Z
Last change time
2024-12-13T17:57:16Z
Assigned to
No Owner
Creator
timon.gehr
Moved to GitHub: dmd#18389 →

Comments

Comment #0 by timon.gehr — 2011-12-22T10:59:57Z
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)
Comment #1 by robert.schadek — 2024-12-13T17:57:16Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18389 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB