diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 23:14:53 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 23:14:53 +0100 |
| commit | 169daa11155988a210fac949297381743f3cb400 (patch) | |
| tree | 602ef5df5ae9ea075ab3d5dac3c8ad60da1ea2cc /lib/libm/csqrtl.c | |
| parent | 4e2112e165fdd94dee58378e3ea32892f3710cd7 (diff) | |
feat: clang-tidy fixes
Diffstat (limited to 'lib/libm/csqrtl.c')
| -rw-r--r-- | lib/libm/csqrtl.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/libm/csqrtl.c b/lib/libm/csqrtl.c index 335e51d6..94bf52f1 100644 --- a/lib/libm/csqrtl.c +++ b/lib/libm/csqrtl.c @@ -1,6 +1,7 @@ -#include <stdbool.h> -#include <float.h> -#include "__complex.h" +#include <complex.h> // for complex, I, cimagl, creall, csqrtl +#include <float.h> // for LDBL_MAX +#include <math.h> // for fabsl, copysignl, hypotl, sqrtl, isinf, INFINITY +#include <stdbool.h> // for bool, false, true #define THRESH (LDBL_MAX / 2.414213562373095048801688724209698L) #define cpackl(r, i) ((r) + (i) * (long double complex)I) @@ -31,8 +32,7 @@ long double complex csqrtl(long double complex z) */ if (signbit(a)) return (cpackl(fabsl(b - b), copysignl(a, b))); - else - return (cpackl(a, copysignl(b - b, b))); + return (cpackl(a, copysignl(b - b, b))); } /* * The remaining special case (b is NaN) is handled just fine by @@ -57,6 +57,5 @@ long double complex csqrtl(long double complex z) /* Rescale. */ if (scale) return (result * 2.0L); - else - return (result); + return (result); } |
