Files
oldlinux-files/Ref-docs/POSIX/susv3/basedefs/complex.h.html
2024-02-19 00:21:47 -05:00

253 lines
10 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
<title>&lt;complex.h&gt;</title>
</head>
<body bgcolor="white">
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
</script>
<basefont size="3"> <a name="&lt;complex.h&gt;"></a> <a name="tag_13_05"></a><!-- &lt;complex.h&gt; -->
<!--header start-->
<center><font size="2">The Open Group Base Specifications Issue 6<br>
IEEE Std 1003.1-2001<br>
Copyright &copy; 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
<!--header end-->
<hr size="2" noshade>
<h4><a name="tag_13_05_01"></a>NAME</h4>
<blockquote>complex.h - complex arithmetic</blockquote>
<h4><a name="tag_13_05_02"></a>SYNOPSIS</h4>
<blockquote class="synopsis">
<p><tt>#include &lt;complex.h&gt;</tt></p>
</blockquote>
<h4><a name="tag_13_05_03"></a>DESCRIPTION</h4>
<blockquote>
<div class="box"><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"
border="0"> The functionality described on this reference page is aligned with the ISO&nbsp;C standard. Any conflict between the
requirements described here and the ISO&nbsp;C standard is unintentional. This volume of IEEE&nbsp;Std&nbsp;1003.1-2001 defers to
the ISO&nbsp;C standard. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></div>
<p>The <i>&lt;complex.h&gt;</i> header shall define the following macros:</p>
<dl compact>
<dt>complex</dt>
<dd>Expands to <b>_Complex</b>.</dd>
<dt>_Complex_I</dt>
<dd>Expands to a constant expression of type <b>const float _Complex</b>, with the value of the imaginary unit (that is, a number
<i>i</i> such that <i>i</i><small><sup>2</sup></small>=-1).</dd>
<dt>imaginary</dt>
<dd>Expands to <b>_Imaginary</b>.</dd>
<dt>_Imaginary_I</dt>
<dd>Expands to a constant expression of type <b>const float _Imaginary</b> with the value of the imaginary unit.</dd>
<dt>I</dt>
<dd>Expands to either _Imaginary_I or _Complex_I. If _Imaginary_I is not defined, I expands to _Complex_I.</dd>
</dl>
<p>The macros imaginary and _Imaginary_I shall be defined if and only if the implementation supports imaginary types.</p>
<p>An application may undefine and then, perhaps, redefine the complex, imaginary, and I macros.</p>
<p>The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.</p>
<pre>
<tt>double cabs(double complex);
float cabsf(float complex);
long double cabsl(long double complex);
double complex cacos(double complex);
float complex cacosf(float complex);
double complex cacosh(double complex);
float complex cacoshf(float complex);
long double complex cacoshl(long double complex);
long double complex cacosl(long double complex);
double carg(double complex);
float cargf(float complex);
long double cargl(long double complex);
double complex casin(double complex);
float complex casinf(float complex);
double complex casinh(double complex);
float complex casinhf(float complex);
long double complex casinhl(long double complex);
long double complex casinl(long double complex);
double complex catan(double complex);
float complex catanf(float complex);
double complex catanh(double complex);
float complex catanhf(float complex);
long double complex catanhl(long double complex);
long double complex catanl(long double complex);
double complex ccos(double complex);
float complex ccosf(float complex);
double complex ccosh(double complex);
float complex ccoshf(float complex);
long double complex ccoshl(long double complex);
long double complex ccosl(long double complex);
double complex cexp(double complex);
float complex cexpf(float complex);
long double complex cexpl(long double complex);
double cimag(double complex);
float cimagf(float complex);
long double cimagl(long double complex);
double complex clog(double complex);
float complex clogf(float complex);
long double complex clogl(long double complex);
double complex conj(double complex);
float complex conjf(float complex);
long double complex conjl(long double complex);
double complex cpow(double complex, double complex);
float complex cpowf(float complex, float complex);
long double complex cpowl(long double complex, long double complex);
double complex cproj(double complex);
float complex cprojf(float complex);
long double complex cprojl(long double complex);
double creal(double complex);
float crealf(float complex);
long double creall(long double complex);
double complex csin(double complex);
float complex csinf(float complex);
double complex csinh(double complex);
float complex csinhf(float complex);
long double complex csinhl(long double complex);
long double complex csinl(long double complex);
double complex csqrt(double complex);
float complex csqrtf(float complex);
long double complex csqrtl(long double complex);
double complex ctan(double complex);
float complex ctanf(float complex);
double complex ctanh(double complex);
float complex ctanhf(float complex);
long double complex ctanhl(long double complex);
long double complex ctanl(long double complex);
</tt>
</pre>
</blockquote>
<hr>
<div class="box"><em>The following sections are informative.</em></div>
<h4><a name="tag_13_05_04"></a>APPLICATION USAGE</h4>
<blockquote>
<p>Values are interpreted as radians, not degrees.</p>
</blockquote>
<h4><a name="tag_13_05_05"></a>RATIONALE</h4>
<blockquote>
<p>The choice of <i>I</i> instead of <i>i</i> for the imaginary unit concedes to the widespread use of the identifier <i>i</i> for
other purposes. The application can use a different identifier, say <i>j</i>, for the imaginary unit by following the inclusion of
the <i>&lt;complex.h&gt;</i> header with:</p>
<pre>
<tt>#undef I
#define j _Imaginary_I
</tt>
</pre>
<p>An <i>I</i> suffix to designate imaginary constants is not required, as multiplication by <i>I</i> provides a sufficiently
convenient and more generally useful notation for imaginary terms. The corresponding real type for the imaginary unit is
<b>float</b>, so that use of <i>I</i> for algorithmic or notational convenience will not result in widening types.</p>
<p>On systems with imaginary types, the application has the ability to control whether use of the macro I introduces an imaginary
type, by explicitly defining I to be _Imaginary_I or _Complex_I. Disallowing imaginary types is useful for some applications
intended to run on implementations without support for such types.</p>
<p>The macro _Imaginary_I provides a test for whether imaginary types are supported.</p>
<p>The <i>cis</i>() function (<i>cos</i>(<i>x</i>) + <i>I</i>*<i>sin</i>(<i>x</i>)) was considered but rejected because its
implementation is easy and straightforward, even though some implementations could compute sine and cosine more efficiently in
tandem.</p>
</blockquote>
<h4><a name="tag_13_05_06"></a>FUTURE DIRECTIONS</h4>
<blockquote>
<p>The following function names and the same names suffixed with <i>f</i> or <i>l</i> are reserved for future use, and may be added
to the declarations in the <i>&lt;complex.h&gt;</i> header.</p>
<blockquote>
<table cellpadding="3">
<tr valign="top">
<td align="left">
<p class="tent"><br>
<i>cerf</i>()<br>
<i>cerfc</i>()<br>
<i>cexp2</i>()<br>
&nbsp;</p>
</td>
<td align="left">
<p class="tent"><br>
<i>cexpm1</i>()<br>
<i>clog10</i>()<br>
<i>clog1p</i>()<br>
&nbsp;</p>
</td>
<td align="left">
<p class="tent"><br>
<i>clog2</i>()<br>
<i>clgamma</i>()<br>
<i>ctgamma</i>()<br>
&nbsp;</p>
</td>
</tr>
</table>
</blockquote>
</blockquote>
<h4><a name="tag_13_05_07"></a>SEE ALSO</h4>
<blockquote>
<p>The System Interfaces volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../functions/cabs.html"><i>cabs</i>()</a>, <a href=
"../functions/cacos.html"><i>cacos</i>()</a>, <a href="../functions/cacosh.html"><i>cacosh</i>()</a>, <a href=
"../functions/carg.html"><i>carg</i>()</a>, <a href="../functions/casin.html"><i>casin</i>()</a>, <a href=
"../functions/casinh.html"><i>casinh</i>()</a>, <a href="../functions/catan.html"><i>catan</i>()</a>, <a href=
"../functions/catanh.html"><i>catanh</i>()</a>, <a href="../functions/ccos.html"><i>ccos</i>()</a>, <a href=
"../functions/ccosh.html"><i>ccosh</i>()</a>, <a href="../functions/cexp.html"><i>cexp</i>()</a>, <a href=
"../functions/cimag.html"><i>cimag</i>()</a>, <a href="../functions/clog.html"><i>clog</i>()</a>, <a href=
"../functions/conj.html"><i>conj</i>()</a>, <a href="../functions/cpow.html"><i>cpow</i>()</a>, <a href=
"../functions/cproj.html"><i>cproj</i>()</a>, <a href="../functions/creal.html"><i>creal</i>()</a>, <a href=
"../functions/csin.html"><i>csin</i>()</a>, <a href="../functions/csinh.html"><i>csinh</i>()</a>, <a href=
"../functions/csqrt.html"><i>csqrt</i>()</a>, <a href="../functions/ctan.html"><i>ctan</i>()</a>, <a href=
"../functions/ctanh.html"><i>ctanh</i>()</a></p>
</blockquote>
<h4><a name="tag_13_05_08"></a>CHANGE HISTORY</h4>
<blockquote>
<p>First released in Issue 6. Included for alignment with the ISO/IEC&nbsp;9899:1999 standard.</p>
</blockquote>
<div class="box"><em>End of informative text.</em></div>
<hr>
<hr size="2" noshade>
<center><font size="2"><!--footer start-->
UNIX &reg; is a registered Trademark of The Open Group.<br>
POSIX &reg; is a registered Trademark of The IEEE.<br>
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
]</font></center>
<!--footer end-->
<hr size="2" noshade>
</body>
</html>