This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: question on wrong result for small numbers from strtod(), strtof()


I'm currently testing a different patch...

Index: strtod.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdlib/strtod.c,v
retrieving revision 1.16
diff -p -U3 -r1.16 strtod.c
--- strtod.c	3 Dec 2009 16:11:27 -0000	1.16
+++ strtod.c	26 Oct 2010 21:29:08 -0000
@@ -519,7 +519,8 @@ _DEFUN (_strtod_r, (ptr, s00, se),
 			}
 #endif
 		}
-	e1 += nd - k;
+	if (nd0 >= DBL_DIG)
+	  e1 += nd - k;
 
 #ifdef IEEE_Arith
 #ifdef SET_INEXACT


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]