3
<title>Complex arithmetic operators - GNU Scientific Library -- Reference Manual</title>
4
<meta http-equiv="Content-Type" content="text/html">
5
<meta name="description" content="GNU Scientific Library -- Reference Manual">
6
<meta name="generator" content="makeinfo 4.8">
7
<link title="Top" rel="start" href="index.html#Top">
8
<link rel="up" href="Complex-Numbers.html#Complex-Numbers" title="Complex Numbers">
9
<link rel="prev" href="Properties-of-complex-numbers.html#Properties-of-complex-numbers" title="Properties of complex numbers">
10
<link rel="next" href="Elementary-Complex-Functions.html#Elementary-Complex-Functions" title="Elementary Complex Functions">
11
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
13
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 The GSL Team.
15
Permission is granted to copy, distribute and/or modify this document
16
under the terms of the GNU Free Documentation License, Version 1.2 or
17
any later version published by the Free Software Foundation; with the
18
Invariant Sections being ``GNU General Public License'' and ``Free Software
19
Needs Free Documentation'', the Front-Cover text being ``A GNU Manual'',
20
and with the Back-Cover Text being (a) (see below). A copy of the
21
license is included in the section entitled ``GNU Free Documentation
24
(a) The Back-Cover Text is: ``You have freedom to copy and modify this
25
GNU Manual, like GNU software.''-->
26
<meta http-equiv="Content-Style-Type" content="text/css">
27
<style type="text/css"><!--
28
pre.display { font-family:inherit }
29
pre.format { font-family:inherit }
30
pre.smalldisplay { font-family:inherit; font-size:smaller }
31
pre.smallformat { font-family:inherit; font-size:smaller }
32
pre.smallexample { font-size:smaller }
33
pre.smalllisp { font-size:smaller }
34
span.sc { font-variant:small-caps }
35
span.roman { font-family:serif; font-weight:normal; }
36
span.sansserif { font-family:sans-serif; font-weight:normal; }
42
<a name="Complex-arithmetic-operators"></a>
43
Next: <a rel="next" accesskey="n" href="Elementary-Complex-Functions.html#Elementary-Complex-Functions">Elementary Complex Functions</a>,
44
Previous: <a rel="previous" accesskey="p" href="Properties-of-complex-numbers.html#Properties-of-complex-numbers">Properties of complex numbers</a>,
45
Up: <a rel="up" accesskey="u" href="Complex-Numbers.html#Complex-Numbers">Complex Numbers</a>
49
<h3 class="section">5.3 Complex arithmetic operators</h3>
51
<p><a name="index-complex-arithmetic-148"></a>
54
— Function: gsl_complex <b>gsl_complex_add</b> (<var>gsl_complex a, gsl_complex b</var>)<var><a name="index-gsl_005fcomplex_005fadd-149"></a></var><br>
55
<blockquote><p>This function returns the sum of the complex numbers <var>a</var> and
57
</p></blockquote></div>
60
— Function: gsl_complex <b>gsl_complex_sub</b> (<var>gsl_complex a, gsl_complex b</var>)<var><a name="index-gsl_005fcomplex_005fsub-150"></a></var><br>
61
<blockquote><p>This function returns the difference of the complex numbers <var>a</var> and
63
</p></blockquote></div>
66
— Function: gsl_complex <b>gsl_complex_mul</b> (<var>gsl_complex a, gsl_complex b</var>)<var><a name="index-gsl_005fcomplex_005fmul-151"></a></var><br>
67
<blockquote><p>This function returns the product of the complex numbers <var>a</var> and
69
</p></blockquote></div>
72
— Function: gsl_complex <b>gsl_complex_div</b> (<var>gsl_complex a, gsl_complex b</var>)<var><a name="index-gsl_005fcomplex_005fdiv-152"></a></var><br>
73
<blockquote><p>This function returns the quotient of the complex numbers <var>a</var> and
75
</p></blockquote></div>
78
— Function: gsl_complex <b>gsl_complex_add_real</b> (<var>gsl_complex a, double x</var>)<var><a name="index-gsl_005fcomplex_005fadd_005freal-153"></a></var><br>
79
<blockquote><p>This function returns the sum of the complex number <var>a</var> and the
80
real number <var>x</var>, z=a+x.
81
</p></blockquote></div>
84
— Function: gsl_complex <b>gsl_complex_sub_real</b> (<var>gsl_complex a, double x</var>)<var><a name="index-gsl_005fcomplex_005fsub_005freal-154"></a></var><br>
85
<blockquote><p>This function returns the difference of the complex number <var>a</var> and the
86
real number <var>x</var>, z=a-x.
87
</p></blockquote></div>
90
— Function: gsl_complex <b>gsl_complex_mul_real</b> (<var>gsl_complex a, double x</var>)<var><a name="index-gsl_005fcomplex_005fmul_005freal-155"></a></var><br>
91
<blockquote><p>This function returns the product of the complex number <var>a</var> and the
92
real number <var>x</var>, z=ax.
93
</p></blockquote></div>
96
— Function: gsl_complex <b>gsl_complex_div_real</b> (<var>gsl_complex a, double x</var>)<var><a name="index-gsl_005fcomplex_005fdiv_005freal-156"></a></var><br>
97
<blockquote><p>This function returns the quotient of the complex number <var>a</var> and the
98
real number <var>x</var>, z=a/x.
99
</p></blockquote></div>
102
— Function: gsl_complex <b>gsl_complex_add_imag</b> (<var>gsl_complex a, double y</var>)<var><a name="index-gsl_005fcomplex_005fadd_005fimag-157"></a></var><br>
103
<blockquote><p>This function returns the sum of the complex number <var>a</var> and the
104
imaginary number i<var>y</var>, z=a+iy.
105
</p></blockquote></div>
108
— Function: gsl_complex <b>gsl_complex_sub_imag</b> (<var>gsl_complex a, double y</var>)<var><a name="index-gsl_005fcomplex_005fsub_005fimag-158"></a></var><br>
109
<blockquote><p>This function returns the difference of the complex number <var>a</var> and the
110
imaginary number i<var>y</var>, z=a-iy.
111
</p></blockquote></div>
114
— Function: gsl_complex <b>gsl_complex_mul_imag</b> (<var>gsl_complex a, double y</var>)<var><a name="index-gsl_005fcomplex_005fmul_005fimag-159"></a></var><br>
115
<blockquote><p>This function returns the product of the complex number <var>a</var> and the
116
imaginary number i<var>y</var>, z=a*(iy).
117
</p></blockquote></div>
120
— Function: gsl_complex <b>gsl_complex_div_imag</b> (<var>gsl_complex a, double y</var>)<var><a name="index-gsl_005fcomplex_005fdiv_005fimag-160"></a></var><br>
121
<blockquote><p>This function returns the quotient of the complex number <var>a</var> and the
122
imaginary number i<var>y</var>, z=a/(iy).
123
</p></blockquote></div>
126
— Function: gsl_complex <b>gsl_complex_conjugate</b> (<var>gsl_complex z</var>)<var><a name="index-gsl_005fcomplex_005fconjugate-161"></a></var><br>
127
<blockquote><p><a name="index-conjugate-of-complex-number-162"></a>This function returns the complex conjugate of the complex number
128
<var>z</var>, z^* = x - i y.
129
</p></blockquote></div>
132
— Function: gsl_complex <b>gsl_complex_inverse</b> (<var>gsl_complex z</var>)<var><a name="index-gsl_005fcomplex_005finverse-163"></a></var><br>
133
<blockquote><p>This function returns the inverse, or reciprocal, of the complex number
134
<var>z</var>, 1/z = (x - i y)/(x^2 + y^2).
135
</p></blockquote></div>
138
— Function: gsl_complex <b>gsl_complex_negative</b> (<var>gsl_complex z</var>)<var><a name="index-gsl_005fcomplex_005fnegative-164"></a></var><br>
139
<blockquote><p>This function returns the negative of the complex number
140
<var>z</var>, -z = (-x) + i(-y).
141
</p></blockquote></div>