Mercurial > mxe-octave
comparison src/build-msvctools/compat/cexp.c @ 3061:f8299bb6c872
Initial support for native MSVC compilation.
* add MSVC support files: compiler wrappers and support libraries
* adapt libiconv to work with MSVC
* adapt gettext to work with MSVC
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Mon, 17 Jun 2013 22:43:11 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3060:cbdf4575016d | 3061:f8299bb6c872 |
---|---|
1 /* | |
2 cexp.c | |
3 Contributed by Danny Smith | |
4 2003-10-20 | |
5 */ | |
6 | |
7 #include <math.h> | |
8 #include <complex.h> | |
9 | |
10 /* cexp (x + I * y) = exp (x) * cos (y) + I * exp (x) * sin (y) */ | |
11 | |
12 double complex cexp (double complex Z) | |
13 { | |
14 double complex Res; | |
15 long double rho = exp (__real__ Z); | |
16 __real__ Res = rho * cos(__imag__ Z); | |
17 __imag__ Res = rho * sin(__imag__ Z); | |
18 return Res; | |
19 } |