[PATCH] make printf output for Infinity and NaN match C99 standard

Bob Wilson bwilson@tensilica.com
Fri Oct 7 05:46:00 GMT 2005


As you can probably tell, I'm working on contributing a bunch of changes from 
Tensilica's copy of newlib.  Here's another one, done by David Weatherford. 
I've also got a bunch of documentation fixes that I'll try to sort through next 
week.

Anyway, this patch makes the output of Infinity and NaN floating-point values 
match the C99 specification: "inf" and "nan" for e/f/g formats and uppercase 
versions of those for E/F/G formats.  The 'F' format wasn't even recognized, so 
the patch fixes that, too.

2005-10-06  David Weatherford  <weath@tensilica.com>

	* libc/stdio/vfprintf.c (_VFPRINTF_R): Recognize 'F' format.
	Print "inf" and "nan" in lowercase for e/f/g formats and in uppercase
	for E/F/G formats.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: printf-c99.diff
Type: text/x-patch
Size: 835 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20051007/f0b50769/attachment.bin>


More information about the Newlib mailing list