tail head cat sleep
QR code linking to this page

Manual Pages  — CEXP


cexp, cexpf – complex exponential functions



Math Library (libm, -lm)


#include <complex.h>

double complex
cexp(double complex z);

float complex
cexpf(float complex z);


The cexp() and cexpf() functions compute the complex exponential of z, also known as cis( z, Ns).


For real numbers x and y, cexp() behaves according to Euler's formula: cexp(x + I*y) = ( e** x, * cos( y, Ns, Pc, Pc, +, Po, Ns I * e** x * sin( y, Ns, Pc, Pc

Generally speaking, infinities, zeroes and NaNs are handled as would be expected from this identity given the usual rules of floating-point arithmetic. However, care is taken to avoid generating NaNs when they are not deserved. For example, mathematically we expect that cimag(cexp(x + I*0)) = 0 regardless of the value of x, and cexp() preserves this identity even if x is ∞ or NaN. Likewise, cexp(-∞ + I*y) = 0 and creal(cexp(∞ + I*y)) = ∞ for any y (even though the latter property is only mathematically true for representable y, .) If y is not finite, the sign of the result is indeterminate.


complex(3), exp(3), math(3)


The cexp() and cexpf() functions conform to ISO/IEC 9899:1999 ("ISO C99").

CEXP (3) March 6, 2011

tail head cat sleep
QR code linking to this page

Please direct any comments about this manual page service to Ben Bullock. Privacy policy.

A typical Unix /bin or /usr/bin directory contains a hundred different kinds of programs, written by dozens of egotistical programmers, each with its own syntax, operating paradigm, rules of use ... strategies for specifying options, and different sets of constraints.
— The Unix Haters' handbook