c_exp.c 349 B

12345678910111213141516171819202122232425
  1. #include "f2c.h"
  2. #ifdef KR_headers
  3. extern double exp(), cos(), sin();
  4. VOID c_exp(r, z) complex *r, *z;
  5. #else
  6. #undef abs
  7. #include "math.h"
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. void c_exp(complex *r, complex *z)
  12. #endif
  13. {
  14. double expx, zi = z->i;
  15. expx = exp(z->r);
  16. r->r = expx * cos(zi);
  17. r->i = expx * sin(zi);
  18. }
  19. #ifdef __cplusplus
  20. }
  21. #endif