Date: Mon, 9 Apr 2012 20:36:56 -0400 From: Rich Felker <dalias@...ifal.cx> To: musl@...ts.openwall.com Subject: Re: float scanner status, upcoming release On Tue, Apr 10, 2012 at 02:09:23AM +0200, Pascal Cuoq wrote: > On Mon, Apr 9, 2012 at 9:21 PM, Rich Felker <dalias@...ifal.cx> wrote: > > And here's the current code (standalone test program) if anybody wants > > to play with it or point out how much single-letter variable names > > suck or whatnot.. :-) > > Line 72: > > x[k] = x[k]*10 + c-'0'; > > I don't understand why this read access to x[k] is initialized. > If I change the declaration of local array x as: You're completely right and I was just getting lucky (and being too lazy to add the right warning options to my command line). x should be set to 0 before the loop, and when k advances, the new x[k] should be set to 0. (Or we could pre-fill the whole array, but that's a huge cache-thrashing waste if the number to be read is small.) I'll send a new version of the code to the list shortly; it's very close to what I intend to commit for use with strtod, etc. Note that nsz has found another problem where extremely small values (smallest subnormal range) don't seem to be getting rounded correctly, so this and other issues need to be fixed before it goes into major production use. Still, I think the overall concept is sound... Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.