Merge commit 'dc97a43d4a70c8773a619f11b95b07a787f6f5b7' into merges
[unleashed.git] / share / man / man3head / complex.h.3head
blobb3c0ac6bdf914ab8259062deaf29f15793422b2c
1 '\" te
2 .\" Copyright (c) 2001, The IEEE and The Open Group.  All Rights Reserved.  Portions  Copyright (c) 2003, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\"  This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH COMPLEX.H 3HEAD "Dec 17, 2003"
11 .SH NAME
12 complex.h, complex \- complex arithmetic
13 .SH SYNOPSIS
14 .LP
15 .nf
16 #include <\fBcomplex.h\fR>
17 .fi
19 .SH DESCRIPTION
20 .sp
21 .LP
22 The <\fBcomplex.h\fR> header defines the following macros:
23 .sp
24 .ne 2
25 .na
26 \fB\fBcomplex\fR\fR
27 .ad
28 .RS 16n
29 Expands to \fB_Complex\fR.
30 .RE
32 .sp
33 .ne 2
34 .na
35 \fB\fB_Complex_I\fR\fR
36 .ad
37 .RS 16n
38 Expands to a constant expression of type const float \fB_Complex\fR, with the
39 value of the imaginary unit (that is, a number i such that i^2=\(mi1).
40 .RE
42 .sp
43 .ne 2
44 .na
45 \fB\fBimaginary\fR\fR
46 .ad
47 .RS 16n
48 Expands to \fB_Imaginary\fR.
49 .RE
51 .sp
52 .ne 2
53 .na
54 \fB\fB_Imaginary_I\fR\fR
55 .ad
56 .RS 16n
57 Expands to a constant expression of type \fBconst float _Imaginary\fR with the
58 value of the imaginary unit.
59 .RE
61 .sp
62 .ne 2
63 .na
64 \fB\fBI\fR\fR
65 .ad
66 .RS 16n
67 Expands to either \fB_Imaginary_I\fR or \fB_Complex_I\fR. If \fB_Imaginary_I\fR
68 is  not defined, \fBI\fR expands to \fB_Complex_I\fR.
69 .RE
71 .sp
72 .LP
73 An application can undefine and then, if appropriate, redefine the
74 \fBcomplex\fR, \fBimaginary\fR, and \fBI\fR macros.
75 .SH USAGE
76 .sp
77 .LP
78 Values are interpreted as radians, not degrees.
79 .SH ATTRIBUTES
80 .sp
81 .LP
82 See \fBattributes\fR(5) for descriptions of the following attributes:
83 .sp
85 .sp
86 .TS
87 box;
88 c | c
89 l | l .
90 ATTRIBUTE TYPE  ATTRIBUTE VALUE
92 Interface Stability     Standard
93 .TE
95 .SH SEE ALSO
96 .sp
97 .LP
98 \fBcabs\fR(3M), \fBcacos\fR(3M), \fBcacosh\fR(3M), \fBcarg\fR(3M),
99 \fBcasin\fR(3M), \fBcasinh\fR(3M), \fBcatan\fR(3M), \fBcatanh\fR(3M),
100 \fBccos\fR(3M), \fBccosh\fR(3M), \fBcexp\fR(3M), \fBcimag\fR(3M),
101 \fBclog\fR(3M), \fBconj\fR(3M), \fBcpow\fR(3M), \fBcproj\fR(3M),
102 \fBcreal\fR(3M), \fBcsin\fR(3M), \fBcsinh\fR(3M), \fBcsqrt\fR(3M),
103 \fBctan\fR(3M), \fBctanh\fR(3M), \fBattributes\fR(5), \fBstandards\fR(5)
104 .SH NOTES
107 The choice of \fBI\fR instead of \fBi\fR for the imaginary unit concedes to the
108 widespread use of the identifier \fBi\fR for other purposes. The application
109 can use a different identifier, say \fBj\fR, for the imaginary unit by
110 following the inclusion of the <\fBcomplex.h\fR> header with:
112 .in +2
114 #undef I
115 #define j _Imaginary_I
117 .in -2
121 An \fBI\fR suffix to designate imaginary constants is not required, as
122 multiplication by \fBI\fR provides a sufficiently convenient and more generally
123 useful notation for imaginary terms. The corresponding real type for the
124 imaginary unit is \fBfloat\fR, so that use of \fBI\fR for algorithmic or
125 notational convenience does not result in widening types.
128 On systems with imaginary types, the application has the ability to control
129 whether use of the macro \fBI\fR introduces an imaginary type, by explicitly
130 defining \fBI\fR to be \fB_Imaginary_I\fR or \fB_Complex_I\fR.
133 Disallowing imaginary types is useful for some applications intended to run on
134 implementations without support for such types.
137 The macro \fB_Imaginary_I\fR provides a test for whether imaginary types are
138 supported. The \fBcis()\fR function \fB(cos(x) + I*sin(x))\fR was considered
139 but rejected because its implementation is easy and straightforward, even
140 though some implementations could compute sine and cosine more efficiently in
141 tandem.