[uClibc]here's a new version of strtod

Erik Andersen andersen at codepoet.org
Tue Dec 12 17:27:29 UTC 2000


On Mon Dec 11, 2000 at 05:58:05PM -0600, Manuel Novoa III wrote:
> 
> Erik,
> 
> Here's an implementation of strtod, along with one support routine.
> Compiling with -Os -fomit-frame-pointer for i386, I get the sizes
> (for all data = 0, bss = 0) for the text section for various selections
> of compile-time options:
> 
>   270  current version converted to doubles + 2 bugs fixed
>   227  above, but uses isdigit macro and switch for sign
> 
>   219  new strtod (stripped-down) version included below
>   222  above + RESTRICT_EXP (prevents exponent overflow)
>   299  above + WANT_ENDPTR (handles endptr properly)
>   317  above + RESTRICT_DIGITS (smarter mantissa processing)
>   329  above + LOG_SCALING (smarter scaling)
>   389  above + STRTOD_ERRNO (sets errno - needs zoicheck.o)
>    45  zoicheck.o (needed for errno support)
> 
>   268  new strtod + RESTRICT_EXP + RESTRICT_DIGITS
>   281  above + LOG_SCALING
> 
> What do you think?

This is pretty slick.  I like it.  :-)

> Also, should these kinds of build options be moved to features.h?
> Or perhaps something like _uClibc.h which is included by features?

So far I have been puttig such things into "Config" in the toplevel directory.
Clearly though, using a "Config.h" would be a good thing for certain types of
options (otherwise the command lines when compiling will get to be 3000 chars
long filled with -DRESTRICT_EXP -DRESTRICT_DIGITS -DLOG_SCALING type stuff)...

Any thoughts on a clean way to do this?

 -Erik

--
Erik B. Andersen   email:  andersen at lineo.com
--This message was written using 73% post-consumer electrons--





More information about the uClibc mailing list