a bug in printf %a

David Schultz das at FreeBSD.ORG
Tue May 8 02:59:54 UTC 2007


On Fri, Apr 06, 2007, Bruno Haible wrote:
> sprintf (buf, "%.2a", 1.51)
> should produce "0x1.83p+0". On FreeBSD it produces "0x1.82p+0", which is
> incorrect since [1] says:
>    "For the a and A conversion specifiers, if FLT_RADIX is a power of 2, the
>     value shall be correctly rounded to a hexadecimal floating number with
>     the given precision."

Fixed in HEAD


More information about the freebsd-standards mailing list