Summary: lossless floating point formatting
Could an option be added to the formatting to elide trailing zero's for %f ?
That way it is possible to create an optimal lossless formatting for which the
s = format(f);
float f2 = to!(float)(s);
The formatting I'm trying to get can be seen here (decimal):
%g fails to format like this because it uses %f for as small as 10^-5,
thus loosing precision for floats with leading zero's, like 0.00001234567.
Fixing this by using %f for 10^-5..10^-1 fails because it doesn't elide
trailing zero's making it suboptimal space-wise.
It would be even nicer to have this lossless formatting added to std.format!
I would even suggest making this the default formatting for floating point;
floating point isn't as straight forward as integral and it is easy to think
the current formatting holds all information.
Compared to the hex %a format this new lossless format will be better readable
(less bug-prone) and generally shorter (0.1 will be 0.1).
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------