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>
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>
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.
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.
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!).
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.