123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #include <features.h>
- #include <math.h>
- #include <complex.h>
- __complex__ double cexp(__complex__ double z)
- {
- __complex__ double ret;
- double r_exponent = exp(__real__ z);
- __real__ ret = r_exponent * cos(__imag__ z);
- __imag__ ret = r_exponent * sin(__imag__ z);
- return ret;
- }
- libm_hidden_def(cexp)
- libm_hidden_proto(cexpf)
- __complex__ float cexpf(__complex__ float z)
- {
- __complex__ float ret;
- double r_exponent = exp((double)__real__ z);
- __real__ ret = r_exponent * (double) cosf(__imag__ z);
- __imag__ ret = r_exponent * (double) sinf(__imag__ z);
- return ret;
- }
- libm_hidden_def(cexpf)
- #if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __NO_LONG_DOUBLE_MATH
- libm_hidden_proto(cexpl)
- __complex__ long double cexpl(__complex__ long double z)
- {
- __complex__ long double ret;
- long double r_exponent = expl(__real__ z);
- __real__ ret = r_exponent * cosl(__imag__ z);
- __imag__ ret = r_exponent * sinl(__imag__ z);
- return ret;
- }
- libm_hidden_def(cexpl)
- #endif
|