Skip to content

Commit

Permalink
math: Fix sqrt losing precision for a very small values of x
Browse files Browse the repository at this point in the history
DONE: RTOS-548
  • Loading branch information
agkaminski committed Aug 9, 2023
1 parent 481eeeb commit 5b9b9d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion math/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ double sqrt(double x)
return __ieee754_sqrt(x);
#else
/* Use reciprocal square root method: */
double xn = (double)(1.0f / (float)x);
double xn = 1.0 / x;

/* IEEE-754 compliant: */
conv_t *init = (conv_t *)&xn;
Expand Down

0 comments on commit 5b9b9d6

Please sign in to comment.