aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib (follow)
Commit message (Expand)AuthorAgeFilesLines
* first commit of the new libm!•••thanks to the hard work of Szabolcs Nagy (nsz), identifying the best (from correctness and license standpoint) implementations from freebsd and openbsd and cleaning them up! musl should now fully support c99 float and long double math functions, and has near-complete complex math support. tgmath should also work (fully on gcc-compatible compilers, and mostly on any c99 compiler). based largely on commit 0376d44a890fea261506f1fc63833e7a686dca19 from nsz's libm git repo, with some additions (dummy versions of a few missing long double complex functions, etc.) by me. various cleanups still need to be made, including re-adding (if they're correct) some asm functions that were dropped. Rich Felker2012-03-133-83/+0
* add deprecated (removed from posix) [efg]cvt() functions•••these have not been heavily tested, but they should work as described in the old standards. probably broken for non-finite values... Rich Felker2012-02-063-0/+52
* fix signed overflows at most-negative values in ato(i|l|ll)•••patch by Pascal Cuoq (with minor tweaks to comments) Rich Felker2011-11-103-6/+9
* fix incorrect long double parameters on arm (and other future ports)•••this was the cause of crashes in printf when attempting to print floating point values. Rich Felker2011-09-191-0/+12
* fix incorrect overflow errors on strtoul, etc.Rich Felker2011-09-054-8/+20
* fix various bugs in new integer parser framework•••1. my interpretation of subject sequence definition was wrong. adjust parser to conform to the standard. 2. some code for handling tail overflow case was missing (forgot to finish writing it). 3. typo (= instead of ==) caused ERANGE to wrongly behave like EINVAL Rich Felker2011-07-144-6/+8
* fix wcsto[iu]max with high characters•••stopping without letting the parser see a stop character prevented getting a result. so treat all high chars as the null character and pass them into the parser. also eliminated ugly tmp var using compound literals. Rich Felker2011-07-142-4/+2
* new restartable integer parsing framework.•••this fixes a number of bugs in integer parsing due to lazy haphazard wrapping, as well as some misinterpretations of the standard. the new parser is able to work character-at-a-time or on whole strings, making it easy to support the wide functions without unbounded space for conversion. it will also be possible to update scanf to use the new parser. Rich Felker2011-07-144-156/+81
* avoid crashing when nel==0 is passed to qsortRich Felker2011-04-291-2/+6
* replace heap sort with smoothsort implementation by Valentin Ochs•••Smoothsort is an adaptive variant of heapsort. This version was written by Valentin Ochs (apo) specifically for inclusion in musl. I worked with him to get it working in O(1) memory usage even with giant array element widths, and to optimize it heavily for size and speed. It's still roughly 4 times as large as the old heap sort implementation, but roughly 20 times faster given an almost-sorted array of 1M elements (20 being the base-2 log of 1M), i.e. it really does reduce O(n log n) to O(n) in the mostly-sorted case. It's still somewhat slower than glibc's Introsort for random input, but now considerably faster than glibc when the input is already sorted, or mostly sorted. Rich Felker2011-04-271-31/+192
* fix broken unsigned comparison in wcstoumaxRich Felker2011-04-071-1/+1
* fix various bugs in strtold:•••0e10000000000000000000000000000000 was setting ERANGE exponent char e/p was considered part of the match even if not followed by a valid decimal value "1e +10" was parsed as "1e+10" hex digits were misinterpreted as 0..5 instead of 10..15 Rich Felker2011-04-031-10/+13
* fix all implicit conversion between signed/unsigned pointers•••sadly the C language does not specify any such implicit conversion, so this is not a matter of just fixing warnings (as gcc treats it) but actual errors. i would like to revisit a number of these changes and possibly revise the types used to reduce the number of casts required. Rich Felker2011-03-252-4/+4
* don't compare elements with themselves during qsort.•••this is actually a workaround for a bug in gcc, whereby it asserts inequality of the keys being compared... Rich Felker2011-02-171-1/+1
* more header fixes, minor warning fixRich Felker2011-02-143-2/+4
* initial check-in, version 0.5.0Rich Felker2011-02-1232-0/+688