amath  1.8.5
Simple command line calculator
cexp.c File Reference
#include "prim.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

◆ cexp()

complex cexp ( complex  z)

Returns e to the power of a complex number.

Definition at line 42 of file cexp.c.

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

Referenced by ccbrt().

43 {
44  complex w;
45  double r, x, y;
46  x = creal(z);
47  y = cimag(z);
48  r = exp(x);
49  w = cpack(r * cos(y), r * sin(y));
50  return w;
51 }
double sin(double x)
Sine function.
Definition: sin.c:86
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 cos(double x)
Cosine function.
Definition: cos.c:87
double creal(complex z)
Real part of complex number.
Definition: prim.c:38
double exp(double x)
Returns the exponential of x.
Definition: exp.c:138
Here is the call graph for this function:
Here is the caller graph for this function: