diff options
Diffstat (limited to 'winsup/mingw/mingwex/complex/ccosf.c')
-rwxr-xr-x | winsup/mingw/mingwex/complex/ccosf.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/complex/ccosf.c b/winsup/mingw/mingwex/complex/ccosf.c new file mode 100755 index 000000000..64a676455 --- /dev/null +++ b/winsup/mingw/mingwex/complex/ccosf.c @@ -0,0 +1,20 @@ +/* + ccosf.c + Contributed by Danny Smith + 2003-12-24 +*/ + +#include <math.h> +#include <complex.h> + +/* ccos (x + I * y) = cos (x) * cosh (y) + + I * (sin (x) * sinh (y)) */ + + +float complex ccosf (float complex Z) +{ + float complex Res; + __real__ Res = cosf (__real__ Z) * coshf ( __imag__ Z); + __imag__ Res = -sinf (__real__ Z) * sinhf ( __imag__ Z); + return Res; +} |