www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - std.writef, std.format: "%a" is wrong for negative zero

reply Don Clugston <dac nospam.com.au> writes:
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
parent "Walter Bright" <newshound digitalmars.com> writes:
You're right, it's a DMC issue, and the fix for it will go out in the next 
DMC update. 
Feb 07 2006