summaryrefslogtreecommitdiffstatshomepage
path: root/lib/libm
Commit message (Collapse)AuthorAge
* lib/libm: Define _IEEE_LIBM only if not set.Alessandro Gatti2024-06-06
| | | | | | | | | fdilibm was originally meant to see _IEEE_LIBM defined from outside the libm code, not it being hardcoded in. Picolibc assumes this assumption holds true and attempts to define itself, conflicting with the existing definition. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
* lib/libm: Do not force floating point type size evaluation.Alessandro Gatti2024-05-31
| | | | | | | | | | | | | | Since C99, `FLT_EVAL_METHOD` should be left for the compiler/libc to define. Its redefinition breaks compilation with picolibc as the target's libc, since it defines said symbol in math.h before the libm define is evaluated by the compiler. In its place, there is a check to make sure floating point type sizes are what are expected to be, triggering a compilation error if those assumptions are no longer valid. Co-authored-by: Angus Gratton <angus@redyak.com.au> Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
* lib/libm: Use __asm__ instead of asm.David Lechner2022-11-10
| | | | | | | | | `asm` is not part of the C standard and causes a complier error when `-std=c99` is used. `__asm__` is the recommended alternative. https://gcc.gnu.org/onlinedocs/gcc/extensions-to-the-c-language-family/alternate-keywords.html Signed-off-by: David Lechner <david@pybricks.com>
* lib/libm: Reduce size of static two_over_pi array.Damien George2020-09-04
| | | | | | Thanks to Jeff Epler for the idea. Signed-off-by: Damien George <damien@micropython.org>
* all: Remove commented-out include statements.stijn2020-04-23
|
* all: Fix implicit floating point to integer conversions.stijn2020-04-18
| | | | These are found when building with -Wfloat-conversion.
* all: Fix implicit conversion from double to float.stijn2020-04-18
| | | | These are found when building with -Wfloat-conversion.
* lib/libm/math: Add implementation of __signbitf, if needed by a port.Damien George2018-09-27
|
* lib/libm/math: Fix int type in float union, uint64_t should be uint32_t.Damien George2018-09-27
| | | | A float is 32-bits wide.
* lib/libm/wf_tgamma: Fix tgammaf handling of -inf, should return nan.Damien George2018-09-04
|
* lib/libm/math: Make tanhf more efficient and handle large numbers.Damien George2018-09-04
| | | | Prior to this patch tanhf(large number) would return nan due to inf/inf.
* lib/libm: Remove implementation of log2f, use MP_NEED_LOG2 instead.Damien George2017-10-10
|
* lib/libm: Fix tanhf so that it correctly handles +/- infinity args.Damien George2017-10-04
|
* all: Use the name MicroPython consistently in commentsAlexander Steffen2017-07-31
| | | | | There were several different spellings of MicroPython present in comments, when there should be only one.
* lib/libm/math: Remove implementations of float conversion functions.Damien George2017-06-14
| | | | | | | | | These implementations are incorrect (eg f2d and d2f don't handle special values like 0.0) and proper versions can be provided by libgcc (or equivalent depending on the toolchain). libgcc is now linked with the stmhal port so that library will provide these functions from now on.
* lib/libm: Use isfinite instead of finitef, for C99 compatibility.Damien George2017-05-31
|
* lib/libm: Add implementation of nearbyintf, from musl-1.1.16.Damien George2017-03-24
|
* lib/libm: Move Thumb-specific sqrtf function to separate file.Damien George2016-11-03
| | | | | This allows it to be used only when the hardware supports VFP instructions, preventing compile errors.
* lib/libm: Remove unused definition of "one".Damien George2016-06-25
|
* lib/libm: Format code to pass gcc v6.1.1 warning.Damien George2016-06-25
| | | | | | gcc 6.1.1 warns when indentation is misleading, and in this case the formatting of the code really is misleading. So adjust the formatting to be clear of the meaning of the code.
* lib/libm: Allow math funcs to be used by non-Thumb archs.Damien George2015-12-18
| | | | Requires addition of software implementation of sqrtf function.
* lib/libm: Add implementations of erf, erfc, lgamma, tgamma.Damien George2015-02-22
|
* lib/libm: Add frexp and modf functions; use in stmhal; add tests.Damien George2015-01-22
| | | | Addresses issue #1081.
* stmhal: Add fake implementation of __aeabi_f2lz().Paul Sokolovsky2014-12-30
| | | | To make mp_obj_new_int_from_float() somehow work.
* lib/libm: Add acosh, asinh, atanh, tan; get working with stmhal.Damien George2014-12-18
| | | | | | | | | acoshf, asinhf, atanhf were added from musl. mathsincos.c was split up into its original, separate files (from newlibe-nano-2). tan was added. All of the important missing float functions are now implemented, and pyboard now passes tests/float/math_fun.py (finally!).
* py: Add builtin round function.Damien George2014-10-31
| | | | Addresses issue #934.
* py: Implement divmod, % and proper // for floating point.Damien George2014-09-13
| | | | Tested and working on unix and pyboard.
* py and libm: Add asinf,acosf; print higher precision for float.Damien George2014-09-11
| | | | | | Also use less stack space when printing single precision float. Addition of asinf and acosf addresses issue #851.
* lib, libm: Add back dummy definition of tanf.Damien George2014-08-29
|
* lib: Add lib and libm, moving current files from stmhal.Damien George2014-08-29
Top-level lib directory is for standard C libraries that we want to provide our own versions of (for efficiency and stand-alone reasons). It currently has libm in it for math functions. Also add atanf and atan2f, which addresses issue #837.