20.09.2015 Views

Programming in C

Kochan - ProgramminginC

Kochan - ProgramminginC

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

488 Appendix B The Standard C Library<br />

Complex Arithmetic<br />

This header file def<strong>in</strong>es various type def<strong>in</strong>itions and functions for work<strong>in</strong>g<br />

with complex numbers. Listed next are several macros that are def<strong>in</strong>ed <strong>in</strong> this file, followed<br />

by functions for perform<strong>in</strong>g complex arithmetic.<br />

Def<strong>in</strong>e<br />

complex<br />

_Complex_I<br />

imag<strong>in</strong>ary<br />

_Imag<strong>in</strong>ary_I<br />

Mean<strong>in</strong>g<br />

Substitute name for the type _Complex<br />

Macro used for specify<strong>in</strong>g the imag<strong>in</strong>ary part of a complex<br />

number (for example, 4 + 6.2 * _Complex_I specifies 4 +<br />

6.2i)<br />

Substitute name for the type _Imag<strong>in</strong>ary; only def<strong>in</strong>ed if the<br />

implementation supports imag<strong>in</strong>ary types<br />

Macro used to specify the imag<strong>in</strong>ary part of an imag<strong>in</strong>ary<br />

number<br />

In the list of functions that follows, y and z are of type double complex, x is of type<br />

double,and n is an <strong>in</strong>t.<br />

double complex cabs (z) 2<br />

Returns the complex absolute value of z.<br />

double complex cacos (z)<br />

Returns the complex arc cos<strong>in</strong>e of z.<br />

double complex cacosh (z)<br />

Returns the complex arc hyperbolic cos<strong>in</strong>e of z.<br />

double carg (z)<br />

Returns the phase angle of z.<br />

double complex cas<strong>in</strong> (z)<br />

Returns the complex arc s<strong>in</strong>e of z.<br />

double complex cas<strong>in</strong>h (z)<br />

Returns the complex arc hyperbolic s<strong>in</strong>e of z.<br />

2.The complex math library conta<strong>in</strong>s float complex, double complex, and long double complex<br />

versions of the functions that take and return float complex, double complex, and long double<br />

complex values.The double complex versions are summarized here.The float complex versions<br />

have the same name with an f on the end (e.g. cacosf).The long double versions have an l on<br />

the end <strong>in</strong>stead (e.g. cacosl).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!