xref: /csrg-svn/usr.bin/f77/libF77/c_log.c (revision 22831)
110445Sdlw /*
2*22831Skre  * Copyright (c) 1980 Regents of the University of California.
3*22831Skre  * All rights reserved.  The Berkeley software License Agreement
4*22831Skre  * specifies the terms and conditions for redistribution.
5*22831Skre  *
6*22831Skre  *	@(#)c_log.c	5.1	06/07/85
710445Sdlw  */
810445Sdlw 
910445Sdlw #include "complex"
1010445Sdlw 
1110445Sdlw c_log(r, z)
1210445Sdlw complex *r, *z;
1310445Sdlw {
1410445Sdlw double log(), cabs(), atan2();
1510445Sdlw 
1610445Sdlw r->imag = atan2(z->imag, z->real);
1710445Sdlw r->real = log( cabs(z->real, z->imag) );
1810445Sdlw }
19