home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / f2c / f77lib / c_log.c < prev    next >
C/C++ Source or Header  |  2000-06-22  |  292b  |  17 lines

  1. #include "f2c.h"
  2.  
  3. #ifdef KR_headers
  4. extern double log(), f__cabs(), atan2();
  5. VOID c_log(r, z) complex *r, *z;
  6. #else
  7. #undef abs
  8. #include "math.h"
  9. extern double f__cabs(double, double);
  10.  
  11. void c_log(complex *r, complex *z)
  12. #endif
  13. {
  14. r->i = atan2(z->i, z->r);
  15. r->r = log( f__cabs(z->r, z->i) );
  16. }
  17.