This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Printf prints NaN for -Inf
- From: "Peter Kabal" <kabal at ECE dot McGill dot CA>
- To: <newlib at sources dot redhat dot com>
- Date: Tue, 12 Nov 2002 09:59:43 -0500
- Subject: Printf prints NaN for -Inf
- Organization: McGill University
I am running gcc 3.2 under Cygwin. I am told that the printf routine
comes from newlib.
The function call log(0) returns the bit pattern for -Inf, but if this
value is given to printf, the printout says "NaN". [printf ("%g\n",
log(0)];
Peter Kabal Kabal@ECE.McGill.CA (514) 398-7130
Electrical & Computer Engineering (514) 398-4470 (FAX)
McGill University
3480 University, Montreal, Quebec, Canada H3A 2A7