summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2005-10-11 22:51:37 +0000
committerJeff Johnston <jjohnstn@redhat.com>2005-10-11 22:51:37 +0000
commitda71e51811022b21354b3d833191c4eeba5b43a7 (patch)
treeefb9954f14bf60647567daf6dbcd8ed7fd8258b6
parent677f3499b3530260200c8b367f36e63128a621bf (diff)
downloadcygnal-da71e51811022b21354b3d833191c4eeba5b43a7.tar.gz
cygnal-da71e51811022b21354b3d833191c4eeba5b43a7.tar.bz2
cygnal-da71e51811022b21354b3d833191c4eeba5b43a7.zip
2005-10-11 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.
-rw-r--r--newlib/ChangeLog6
-rw-r--r--newlib/libc/stdio/vfprintf.c11
2 files changed, 15 insertions, 2 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index f81f154a9..05e9a0092 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-11 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.
+
2005-10-07 Bob Wilson <bob.wilson@acm.org>
* libc/stdlib/mallocr.c (mALLOc, rEALLOCc, mEMALIGn): Set errno
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index c51b6b821..1c887d5aa 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -800,6 +800,7 @@ reswitch: switch (ch) {
case 'e':
case 'E':
case 'f':
+ case 'F':
case 'g':
case 'G':
if (prec == -1) {
@@ -819,12 +820,18 @@ reswitch: switch (ch) {
if (isinf (_fpvalue)) {
if (_fpvalue < 0)
sign = '-';
- cp = "Inf";
+ if (ch == 'E' || ch == 'F' || ch == 'G')
+ cp = "INF";
+ else
+ cp = "inf";
size = 3;
break;
}
if (isnan (_fpvalue)) {
- cp = "NaN";
+ if (ch == 'E' || ch == 'F' || ch == 'G')
+ cp = "NAN";
+ else
+ cp = "nan";
size = 3;
break;
}