amath  1.8.5
Simple command line calculator
clog.c File Reference
#include "prim.h"
Include dependency graph for clog.c:

Go to the source code of this file.

Functions

complex clog (complex z)
 Natural logarithm of a complex number. More...
 

Function Documentation

◆ clog()

complex clog ( complex  z)

Natural logarithm of a complex number.

Definition at line 42 of file clog.c.

References atan2(), cabs(), cimag(), cpack(), creal(), and log().

Referenced by cacos(), cacosh(), cacot(), cacoth(), cacsc(), cacsch(), casec(), casech(), casin(), casinh(), catan(), catanh(), ccbrt(), clog10(), clogb(), and ComplexNumber::Log().

43 {
44  complex w;
45  double p, q;
46  p = log(cabs(z));
47  q = atan2(cimag(z), creal(z));
48  w = cpack(p, q);
49  return w;
50 }
Definition: mathi.h:48
complex cpack(double x, double y)
Pack two real numbers into a complex number.
Definition: prim.c:68
double cimag(complex z)
Imaginary part of complex number.
Definition: prim.c:46
double atan2(double y, double x)
Inverse tangent function.
Definition: atan2.c:87
double creal(complex z)
Real part of complex number.
Definition: prim.c:38
double log(double x)
Natural logarithm function (base e)
Definition: log.c:109
double cabs(complex z)
Absolute value of complex number.
Definition: prim.c:54
Here is the call graph for this function:
Here is the caller graph for this function: