Date: Wed, 26 Nov 1997 13:32:13 +0200 (IST) From: Eli Zaretskii To: Morten Welinder cc: djgpp-workers AT delorie DOT com, dj AT delorie DOT com Subject: Re: strtod.c In-Reply-To: <199711260257.DAA27796@tyr.diku.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 26 Nov 1997, Morten Welinder wrote: > Your patch looks ok, but what about "1e-2000000000"? You're on! (Let's see how much more code bloat from me can DJ accept ;-) diff -c src/libc/ansi/stdlib/strtod.c~0 src/libc/ansi/stdlib/strtod.c *** src/libc/ansi/stdlib/strtod.c~0 Wed Nov 26 12:39:26 1997 --- src/libc/ansi/stdlib/strtod.c Wed Nov 26 13:09:42 1997 *************** *** 95,101 **** --- 95,109 ---- } else if (esign < 0) for (i = 1; i <= e; i++) + { r *= 0.1L; + if (r < DBL_MIN) /* detect underflow */ + { + errno = ERANGE; + r = 0.0; + break; + } + } else for (i = 1; i <= e; i++) {