Bug 675 – %a format has an out-by-1 bug for denormals.
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-12-11T08:00:00Z
Last change time
2014-02-15T13:18:54Z
Assigned to
bugzilla
Creator
clugdbug
Comments
Comment #0 by clugdbug — 2006-12-11T08:00:02Z
I think this is a bug in the DMC library. It also affects the D name-mangling of template float arguments.
void main()
{
printf("%La %La\n", 0x1p-16382L, 0x1p-16383L);
}
prints:
-----------
0x1p-16382 0x1p-16384
------------
Comment #1 by clugdbug — 2009-02-25T02:58:08Z
If x is denormal, the %La format always prints the exponent higher by 1, than the correct value. The mantissa is always correct.
Comment #2 by clugdbug — 2009-02-27T07:36:21Z
I thought the problem might have been in frexpl(), but it isn't -- I can confirm that frexpl works correctly. The bug must be in __pfloatfmt somewhere.