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