this repo has no description
1.\" Copyright (c) 2006 Apple Computer
2.\"
3.Dd December 11, 2006
4.Dt CREAL 3
5.Os BSD 4
6.Sh NAME
7.Nm creal
8.Nd complex real-part function
9.br
10.Nm cimag
11.Nd complex imaginary-part function
12.Sh SYNOPSIS
13.Fd #include <complex.h>
14.Ft double
15.Fn creal "double complex z"
16.Ft long double
17.Fn creall "long double complex z"
18.Ft float
19.Fn crealf "float complex z"
20.Pp
21.Ft double
22.Fn cimag "double complex z"
23.Ft long double
24.Fn cimagl "long double complex z"
25.Ft float
26.Fn cimagf "float complex z"
27.Sh DESCRIPTION
28.Fn creal "z"
29extracts the real part of the complex floating-point number
30.Fa z .
31.Fn cimag "z"
32extracts the imaginary part of the complex floating-point number
33.Fa z .
34.Pp
35If
36.Fa z
37= x+iy, then
38.Fn creal "z"
39= x
40and
41.Fn cimag "z"
42= y.
43.Sh EXAMPLES
44The function foo defined in the example below returns its complex
45argument with the imaginary part scaled by a factor of 2.
46.Bd -literal -offset indent
47#include <complex.h>
48
49double complex foo(double complex z) {
50 return creal(z) + 2.0*cimag(z)*I;
51}
52.Ed
53.Sh SEE ALSO
54.Xr complex 3
55.Sh STANDARDS
56The
57.Fn creal
58and
59.Fn cimag
60functions conform to ISO/IEC 9899:1999(E).