amath  1.6.2
Simple command line calculator
cexp.c File Reference
#include "prim.h"
#include "math.h"
#include "complex.h"
Include dependency graph for cexp.c:

Go to the source code of this file.

Functions

complex cexp (complex z)
 Returns e to the power of a complex number. More...
 

Function Documentation

complex cexp ( complex  z)

Returns e to the power of a complex number.

Version
1.1
Date
2007/08/20

Definition at line 46 of file cexp.c.

References cimag(), cos(), cpack(), creal(), exp(), and sin().

Referenced by ccbrt().

47 {
48  complex w;
49  double r, x, y;
50  x = creal(z);
51  y = cimag(z);
52  r = exp(x);
53  w = cpack(r * cos(y), r * sin(y));
54  return w;
55 }
double exp(double x)
Returns the exponential of x.
Definition: exp.c:134
double cos(double x)
Trigonometric cosine function.
Definition: cos.c:87
double sin(double x)
Trigonometric sine function.
Definition: sin.c:87
complex cpack(double x, double y)
Pack two real numbers into a complex number.
Definition: prim.c:71
double creal(complex z)
Real part of complex number.
Definition: prim.c:38
double cimag(complex z)
Imaginary part of complex number.
Definition: prim.c:47

Here is the call graph for this function:

Here is the caller graph for this function: