Browse Source

libc: minimal: math: Removed undefined behavior in sqrt routines

Fixed a clang config warning.

Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
pull/79203/head
Lars-Ove Karlsson 10 months ago committed by Fabio Baltieri
parent
commit
8fceb6421f
  1. 1
      lib/libc/minimal/source/math/sqrt.c
  2. 1
      lib/libc/minimal/source/math/sqrtf.c

1
lib/libc/minimal/source/math/sqrt.c

@ -27,6 +27,7 @@ double sqrt(double square) @@ -27,6 +27,7 @@ double sqrt(double square)
int64double_t root;
int64double_t last;
int64double_t p_square;
p_square.d = square;
if (square == 0.0) {

1
lib/libc/minimal/source/math/sqrtf.c

@ -27,6 +27,7 @@ float sqrtf(float square) @@ -27,6 +27,7 @@ float sqrtf(float square)
intfloat_t root;
intfloat_t last;
intfloat_t p_square;
p_square.f = square;
if (square == 0.0f) {

Loading…
Cancel
Save