110552Sdlw /* 222999Skre * Copyright (c) 1980 Regents of the University of California. 322999Skre * All rights reserved. The Berkeley software License Agreement 422999Skre * specifies the terms and conditions for redistribution. 522999Skre * 6*29972Smckusick * @(#)z_log.c 5.2 11/03/86 710552Sdlw */ 810552Sdlw 910552Sdlw #include "complex" 10*29972Smckusick #ifdef tahoe 11*29972Smckusick #define cabs zabs 12*29972Smckusick #endif tahoe 1310552Sdlw 1410552Sdlw z_log(r, z) 1510552Sdlw dcomplex *r, *z; 1610552Sdlw { 1710552Sdlw double log(), cabs(), atan2(); 1810552Sdlw 1910552Sdlw r->dimag = atan2(z->dimag, z->dreal); 2010552Sdlw r->dreal = log( cabs( z->dreal, z->dimag ) ); 2110552Sdlw } 22