1: /* 2: * Copyright (c) 1980 Regents of the University of California. 3: * All rights reserved. The Berkeley software License Agreement 4: * specifies the terms and conditions for redistribution. 5: * 6: * @(#)z_log.c 5.1 6/7/85 7: */ 8: 9: #include "complex" 10: 11: z_log(r, z) 12: dcomplex *r, *z; 13: { 14: double log(), cabs(), atan2(); 15: 16: r->dimag = atan2(z->dimag, z->dreal); 17: r->dreal = log( cabs( z->dreal, z->dimag ) ); 18: }