xref: /csrg-svn/usr.bin/f77/libF77/c_log.c (revision 47940)
1*47940Sbostic /*-
2*47940Sbostic  * Copyright (c) 1980 The Regents of the University of California.
3*47940Sbostic  * All rights reserved.
422831Skre  *
5*47940Sbostic  * %sccs.include.proprietary.c%
610445Sdlw  */
710445Sdlw 
8*47940Sbostic #ifndef lint
9*47940Sbostic static char sccsid[] = "@(#)c_log.c	5.2 (Berkeley) 04/12/91";
10*47940Sbostic #endif /* not lint */
11*47940Sbostic 
1210445Sdlw #include "complex"
1310445Sdlw 
c_log(r,z)1410445Sdlw c_log(r, z)
1510445Sdlw complex *r, *z;
1610445Sdlw {
1710445Sdlw double log(), cabs(), atan2();
1810445Sdlw 
1910445Sdlw r->imag = atan2(z->imag, z->real);
2010445Sdlw r->real = log( cabs(z->real, z->imag) );
2110445Sdlw }
22