# FreeBSD Manual Pages

CEXP(3) BSD Library Functions Manual CEXP(3)NAMEcexp,cexpf-- complex exponential functionsLIBRARYMath Library (libm, -lm)SYNOPSIS#include<complex.h>doublecomplexcexp(doublecomplexz);floatcomplexcexpf(floatcomplexz);DESCRIPTIONThecexp() andcexpf() functions compute the complex exponential ofz, also known ascis(z).RETURN VALUESFor real numbersxandy,cexp() behaves according to Euler's formula:cexp(x+I*y) = (e**x*cos(y)) + (I*e**x*sin(y)) Generally speaking, infinities, zeroes andNaNs are handled as would be expected from this identity given the usual rules of floating-point arithmetic. However, care is taken to avoid generatingNaNs when they are not deserved. For example, mathematically we expect thatcimag(cexp(x+I*0)) = 0 regardless of the value ofx, andcexp() pre- serves this identity even ifxis infinity orNaN. Likewise,cexp(-infinity+I*y) = 0 andcreal(cexp(infinity+I*y)) = infinity for anyy(even though the latter property is only mathematically true for representabley.) Ifyis not finite, the sign of the result is indeter- minate.SEE ALSOcomplex(3), exp(3), math(3)STANDARDSThecexp() andcexpf() functions conform to ISO/IEC 9899:1999 ("ISO C99"). BSD March 6, 2011 BSD

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUES | SEE ALSO | STANDARDS

Want to link to this manual page? Use this URL:

<https://man.freebsd.org/cgi/man.cgi?query=cexp&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>