Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Apr 2007 03:35:22 +0200
From:      Bruno Haible <bruno@clisp.org>
To:        freebsd-standards@FreeBSD.org
Subject:   a bug in printf %a
Message-ID:  <200704060335.22770.bruno@clisp.org>

next in thread | raw e-mail | index | archive | help
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."

[1] http://www.opengroup.org/susv3/functions/fprintf.html
[2] http://article.gmane.org/gmane.comp.lib.gnulib.bugs/10034




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704060335.22770.bruno>