digitalmars.D.bugs - std.writef, std.format: "%a" is wrong for negative zero
- Don Clugston (13/13) Jan 30 2006 import std.stdio;
- Walter Bright (2/2) Feb 07 2006 You're right, it's a DMC issue, and the fix for it will go out in the ne...
import std.stdio; void main() { writefln("%a", -0.0); } should print -0x0.p+0, but instead prints 0x0.p+0. Clearly, it's using a "<0" test for the sign, when it should be using signbit(). Also applies to the %A option. The %f, %e, and %g formats work correctly. This is actually a DMC library bug, so it applies in many places. DMD 0.145 Windows. Probably doesn't occur with GDC. (I don't think this really belongs in DStress, since it's a DMC bug, not a D bug).
Jan 30 2006
You're right, it's a DMC issue, and the fix for it will go out in the next DMC update.
Feb 07 2006