Petro Karashchenko b859f2750b libc/math: fix log and logf calculations on ARMv7 (and maybe others)
Probably this is a bug of a GCC, but on AMRv7 the code "if (relax_factor > 1)"
generates "bne.n" instruction if "relax_factor" is "int". Few lines above
"relax_factor *= LOG_RELAX_MULTIPLIER;" is done without overflow check hence
at some moment overflow occurs and "relax_factor" becomes a zero and condition
"if (relax_factor > 1)" becomes always evaluated to "true" hence "epsilon"
becomes zero always.

Probably this is not the best way to fix the bug (The best way is to report it
to GCC), but this change allows to get correct behavior of "log" and "logf" for
ARMv7 based MCUs

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-01 20:38:38 +08:00
..
2021-04-02 11:12:25 -05:00
2021-04-02 11:12:25 -05:00
2021-04-02 11:12:25 -05:00
2020-08-14 07:27:55 -05:00
2021-04-02 11:12:25 -05:00
2021-04-03 04:20:31 -07:00
2021-04-03 04:20:31 -07:00
2021-04-03 04:20:31 -07:00
2021-04-02 11:12:25 -05:00
2021-04-02 11:12:25 -05:00
2020-01-07 09:06:02 -06:00
2020-01-07 09:06:02 -06:00
2020-01-07 09:06:02 -06:00
2021-04-02 11:12:25 -05:00