summaryrefslogtreecommitdiff
path: root/src/stdlib/strtod.c
AgeCommit message (Collapse)AuthorLines
2013-07-24add _l versions of strtod family functions, purely as aliasesRich Felker-0/+8
this is a cheat since the _l versions take an extra argument, but since these functions are only here for ABI purposes, it doesn't really matter as long as the ABI matches. if the non-__-prefixed versions are eventually made public, they should proabably be real functions rather than hacks like this.
2012-09-06use restrict everywhere it's required by c99 and/or posix 2008Rich Felker-3/+3
to deal with the fact that the public headers may be used with pre-c99 compilers, __restrict is used in place of restrict, and defined appropriately for any supported compiler. we also avoid the form [restrict] since older versions of gcc rejected it due to a bug in the original c99 standard, and instead use the form *restrict.
2012-04-19fix really bad breakage in strtol, etc.: failure to accept leading spacesRich Felker-5/+3
2012-04-10add "scan helper getc" and rework strtod, etc. to use itRich Felker-2/+4
the immediate benefit is a significant debloating of the float parsing code by moving the responsibility for keeping track of the number of characters read to a different module. by linking shgetc with the stdio buffer logic, counting logic is defered to buffer refill time, keeping the calls to shgetc fast and light. in the future, shgetc will also be useful for integrating the new float code with scanf, which needs to not only count the characters consumed, but also limit the number of characters read based on field width specifiers. shgetc may also become a useful tool for simplifying the integer parsing code.
2012-04-10unify strtof/strtod/strtold wrappers and fix initial whitespace issueRich Felker-4/+21
2012-04-10new floating point parser/converterRich Felker-1/+10
this version is intended to be fully conformant to the ISO C, POSIX, and IEEE standards for conversion of decimal/hex floating point strings to float, double, and long double (ld64 or ld80 only at present) values. in particular, all results are intended to be rounded correctly according to the current rounding mode. further, this implementation aims to set the floating point underflow, overflow, and inexact flags to reflect the conversion performed. a moderate amount of testing has been performed (by nsz and myself) prior to integration of the code in musl, but it still may have bugs. so far, only strto(d|ld|f) use the new code. scanf integration will be done as a separate commit, and i will add implementations of the wide character functions later.
2011-02-12initial check-in, version 0.5.0v0.5.0Rich Felker-0/+6