On Mon, Jul 12, 2004 at 09:20:31AM -0400, Dan Sugalski wrote: > On Mon, 12 Jul 2004, Leopold Toetsch wrote: > > > 1) I've serious troubles with the precision of string_to_num. The test > > bewow fails, 1.e100 isn't really 10**100. > > 2) I've modified string_to_num to just use atof() which works. > > I so wish this were the case. Unfortunately it's not. atof's behaviour > isn't standardized across platforms--using it means that source will > behave differently depending on where it's compiled, which is bad.
I'm pretty sure atof()'s behaviour can be standardised if one preprocesses to get rid of the C99 braindeath first (0x... being hex floating point constants) > I thought we'd grabbed perl 5's string-to-num code. If not, we should. The > licenses match, and we know it works. In my opinion it doesn't work well enough. It can't do NaNs or Infs, and it suffers rounding errors on some architectures and platforms (Notably long doubles in various places, and Crays, because Crays don't round in the IEEE way) Nicholas Clark