getopt: fix null pointer arithmetic ub
[musl] / src / complex / cacosh.c
1 #include "complex_impl.h"
2
3 /* acosh(z) = i acos(z) */
4
5 double complex cacosh(double complex z)
6 {
7         int zineg = signbit(cimag(z));
8
9         z = cacos(z);
10         if (zineg) return CMPLX(cimag(z), -creal(z));
11         else       return CMPLX(-cimag(z), creal(z));
12 }