-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Bruno Haible on 4/4/2007 6:28 PM: > On FreeBSD 6.1, printf of "%010a" of Infinity and NaN yields > "0000000inf" and "0000000nan", respectively. > > While on glibc systems, it yields > " inf" and " nan", respectively. > > I find glibc's output more sensible, since strtod will accept it, while > strtod will not grok "0000000inf". But FreeBSD appears to be closer to > the POSIX wording, I won't count it as a FreeBSD bug.
I would, though. POSIX allows "inf" vs. "infinity", but unless %010f prints "0000000inf", I don't think %010a should do so either, because POSIX was clear that "A double argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier." For that matter, I would really like it if you could guarantee that the digit immediately before the . were less than FLT_RADIX. POSIX doesn't require it, but I find it nicer to see 0x1.0p+0 rather than the somewhat disconcerting 0x8.0p-3. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGFGFw84KuGfSFAYARAgWdAJ0SVwMINjVcNctW7DjNkEEdBhnRbQCeK7wx VvRKgbYfBxWerLeQ1vDYX+g= =nEse -----END PGP SIGNATURE-----