[Issue 5687] std.string.format() error with "%a"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 3 01:15:30 PST 2011


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug at yahoo.com.au


--- Comment #2 from Don <clugdbug at yahoo.com.au> 2011-03-03 01:12:37 PST ---
(In reply to comment #1)
> I've found the cause for this:  1.2 is a double, and should be formatted as
> such, but it is converted to a real internally in std.format.doFormat().

I don't think that's the reason. On Windows, the %A format always begins with
0x1.  (except of course for 0, NaN, inf).
You will never, under any circumstances, see something beginning with 0x9.
Is it actually true that %A on Linux for doubles always begins with 0x1.  ?
If so, then it's a Linux %A bug for reals.

In fact, converting from double to real should NEVER change the %a result.


> I think the right way to go is to rewrite std.string.format() in terms of
> std.format.formattedWrite() instead of std.format.doFormat().

-- 
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