| www.delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mail set sender to djgpp-workers-bounces using -f |
| X-Recipient: | djgpp-workers AT delorie DOT com |
| X-Authenticated: | #27081556 |
| X-Provags-ID: | V01U2FsdGVkX1+/9MpMc6m/8FAEff7UkbAQb8CUkWsKomKU/fQ6PM |
| M4OmRzf8tsRJHp | |
| Message-ID: | <51364BCD.1030807@gmx.de> |
| Date: | Tue, 05 Mar 2013 20:47:25 +0100 |
| From: | Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de> |
| User-Agent: | Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121025 Thunderbird/16.0.2 |
| MIME-Version: | 1.0 |
| To: | djgpp-workers AT delorie DOT com |
| Subject: | Printing sign of NaN. |
| X-Y-GMX-Trusted: | 0 |
| Reply-To: | djgpp-workers AT delorie DOT com |
ONFY while I was testing trunc() I noted that printf did not print the
sign of NaN. The committed small patch below fixes the issue.
Regards,
Juan M. Guerrero
Index: djgpp/src/libc/ansi/stdio/doprnt.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/ansi/stdio/doprnt.c,v
retrieving revision 1.32
diff -U 5 -r1.32 doprnt.c
--- djgpp/src/libc/ansi/stdio/doprnt.c 11 Dec 2012 23:35:30 -0000 1.32
+++ djgpp/src/libc/ansi/stdio/doprnt.c 5 Mar 2013 19:41:25 -0000
@@ -378,11 +378,11 @@
/*
* softsign avoids negative 0 if _double is < 0 and
* no significant digits will be shown
*/
softsign = 0;
- if (_ldouble < 0)
+ if (_ldouble < 0 || (IS_NAN(ieee_value) && ieee_value.ldt.sign))
{
softsign = '-';
_ldouble = -_ldouble;
neg_ldouble = true;
}
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |