mpc.info revision 1.1.1.5
1This is mpc.info, produced by makeinfo version 6.7 from mpc.texi.
2
3This manual is for GNU MPC, a library for multiple precision complex
4arithmetic, version 1.2.1 of October 2020.
5
6   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
72011, 2012, 2013, 2016, 2018, 2020 INRIA
8
9     Permission is granted to copy, distribute and/or modify this
10     document under the terms of the GNU Free Documentation License,
11     Version 1.3 or any later version published by the Free Software
12     Foundation; with no Invariant Sections.  A copy of the license is
13     included in the section entitled "GNU Free Documentation License."
14INFO-DIR-SECTION GNU Packages
15START-INFO-DIR-ENTRY
16* mpc: (mpc)Multiple Precision Complex Library.
17END-INFO-DIR-ENTRY
18
19
20File: mpc.info,  Node: Top,  Next: Copying,  Up: (dir)
21
22GNU MPC
23*******
24
25This manual documents how to install and use the GNU Multiple Precision
26Complex Library, version 1.2.1
27
28* Menu:
29
30* Copying::                     GNU MPC Copying Conditions (LGPL).
31* Introduction to GNU MPC::         Brief introduction to GNU MPC.
32* Installing GNU MPC::              How to configure and compile the GNU MPC library.
33* Reporting Bugs::              How to usefully report bugs.
34* GNU MPC Basics::                  What every GNU MPC user should know.
35* Complex Functions::           Functions for arithmetic on complex numbers.
36* References::
37* Concept Index::
38* Function Index::
39* GNU Free Documentation License::
40
41
42File: mpc.info,  Node: Copying,  Next: Introduction to GNU MPC,  Prev: Top,  Up: Top
43
44GNU MPC Copying Conditions
45**************************
46
47GNU MPC is free software; you can redistribute it and/or modify it under
48the terms of the GNU Lesser General Public License as published by the
49Free Software Foundation; either version 3 of the License, or (at your
50option) any later version.
51
52   GNU MPC is distributed in the hope that it will be useful, but
53WITHOUT ANY WARRANTY; without even the implied warranty of
54MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
55General Public License for more details.
56
57   You should have received a copy of the GNU Lesser General Public
58License along with this program.  If not, see
59<http://www.gnu.org/licenses/>.
60
61
62File: mpc.info,  Node: Introduction to GNU MPC,  Next: Installing GNU MPC,  Prev: Copying,  Up: Top
63
641 Introduction to GNU MPC
65*************************
66
67GNU MPC is a portable library written in C for arbitrary precision
68arithmetic on complex numbers providing correct rounding.  It implements
69a multiprecision equivalent of the C99 standard.  It builds upon the GNU
70MP and the GNU MPFR libraries.
71
721.1 How to use this Manual
73==========================
74
75Everyone should read *note GNU MPC Basics::.  If you need to install the
76library yourself, you need to read *note Installing GNU MPC::, too.
77
78   The remainder of the manual can be used for later reference, although
79it is probably a good idea to skim through it.
80
81
82File: mpc.info,  Node: Installing GNU MPC,  Next: Reporting Bugs,  Prev: Introduction to GNU MPC,  Up: Top
83
842 Installing GNU MPC
85********************
86
87To build GNU MPC, you first have to install GNU MP (version 5.0.0 or
88higher) and GNU MPFR (version 4.1.0 or higher) on your computer.  You
89need a C compiler; GCC version 4.4 or higher is recommended, since GNU
90MPC may trigger a bug in previous versions, see the thread at
91<http://lists.gforge.inria.fr/pipermail/mpc-discuss/2011-February/000823.html>.
92And you need a standard Unix 'make' program, plus some other standard
93Unix utility programs.
94
95   Here are the steps needed to install the library on Unix systems:
96
97  1. 'tar xzf mpc-1.2.1.tar.gz'
98
99  2. 'cd mpc-1.2.1'
100
101  3. './configure'
102
103     if GMP and GNU MPFR are installed into standard directories, that
104     is, directories that are searched by default by the compiler and
105     the linking tools.
106
107     './configure --with-gmp=<gmp_install_dir>'
108
109     is used to indicate a different location where GMP is installed.
110     Alternatively, you can specify directly GMP include and GMP lib
111     directories with './configure --with-gmp-lib=<gmp_lib_dir>
112     --with-gmp-include=<gmp_include_dir>'.
113
114     './configure --with-mpfr=<mpfr_install_dir>'
115
116     is used to indicate a different location where GNU MPFR is
117     installed.  Alternatively, you can specify directly GNU MPFR
118     include and GNU MPFR lib directories with './configure
119     --with-mpf-lib=<mpfr_lib_dir>
120     --with-mpfr-include=<mpfr_include_dir>'.
121
122     Another useful parameter is '--prefix', which can be used to
123     specify an alternative installation location instead of
124     '/usr/local'; see 'make install' below.
125
126     To enable checking for memory leaks using 'valgrind' during 'make
127     check', add the parameter '--enable-valgrind-tests'.
128
129     If for debugging purposes you wish to log calls to GNU MPC
130     functions from within your code, add the parameter
131     '--enable-logging'.  In your code, replace the inclusion of 'mpc.h'
132     by 'mpc-log.h' and link the executable dynamically.  Then all calls
133     to functions with only complex arguments are printed to 'stderr' in
134     the following form: First, the function name is given, followed by
135     its type such as 'c_cc', meaning that the function has one complex
136     result (one 'c' in front of the '_'), computed from two complex
137     arguments (two 'c' after the '_').  Then, the precisions of the
138     real and the imaginary part of the first result is given, followed
139     by the second one and so on.  Finally, for each argument, the
140     precisions of its real and imaginary part are specified and the
141     argument itself is printed in hexadecimal via the function
142     'mpc_out_str' (*note String and Stream Input and Output::).  The
143     option requires a dynamic library, so it may not be combined with
144     '--disable-shared'.
145
146     Use './configure --help' for an exhaustive list of parameters.
147
148  4. 'make'
149
150     This compiles GNU MPC in the working directory.
151
152  5. 'make check'
153
154     This will make sure GNU MPC was built correctly.
155
156     If you get error messages, please report them to
157     'mpc-discuss@lists.gforge.inria.fr' (*Note Reporting Bugs::, for
158     information on what to include in useful bug reports).
159
160  6. 'make install'
161
162     This will copy the file 'mpc.h' to the directory
163     '/usr/local/include', the file 'libmpc.a' to the directory
164     '/usr/local/lib', and the file 'mpc.info' to the directory
165     '/usr/local/share/info' (or if you passed the '--prefix' option to
166     'configure', using the prefix directory given as argument to
167     '--prefix' instead of '/usr/local').  Note: you need write
168     permissions on these directories.
169
1702.1 Other 'make' Targets
171========================
172
173There are some other useful make targets:
174
175   * 'info'
176
177     Create an info version of the manual, in 'mpc.info'.
178
179   * 'pdf'
180
181     Create a PDF version of the manual, in 'doc/mpc.pdf'.
182
183   * 'dvi'
184
185     Create a DVI version of the manual, in 'doc/mpc.dvi'.
186
187   * 'ps'
188
189     Create a Postscript version of the manual, in 'doc/mpc.ps'.
190
191   * 'html'
192
193     Create an HTML version of the manual, in several pages in the
194     directory 'doc/mpc.html'; if you want only one output HTML file,
195     then type 'makeinfo --html --no-split mpc.texi' instead.
196
197   * 'clean'
198
199     Delete all object files and archive files, but not the
200     configuration files.
201
202   * 'distclean'
203
204     Delete all files not included in the distribution.
205
206   * 'uninstall'
207
208     Delete all files copied by 'make install'.
209
2102.2 Known Build Problems
211========================
212
213On AIX, if GMP was built with the 64-bit ABI, before building and
214testing GNU MPC, it might be necessary to set the 'OBJECT_MODE'
215environment variable to 64 by, e.g.,
216
217   'export OBJECT_MODE=64'
218
219   This has been tested with the C compiler IBM XL C/C++ Enterprise
220Edition V8.0 for AIX, version: 08.00.0000.0021, GMP 4.2.4 and GNU MPFR
2212.4.1.
222
223   Please report any other problems you encounter to
224'mpc-discuss@lists.gforge.inria.fr'.  *Note Reporting Bugs::.
225
226
227File: mpc.info,  Node: Reporting Bugs,  Next: GNU MPC Basics,  Prev: Installing GNU MPC,  Up: Top
228
2293 Reporting Bugs
230****************
231
232If you think you have found a bug in the GNU MPC library, please
233investigate and report it.  We have made this library available to you,
234and it is not to ask too much from you, to ask you to report the bugs
235that you find.
236
237   There are a few things you should think about when you put your bug
238report together.
239
240   You have to send us a test case that makes it possible for us to
241reproduce the bug.  Include instructions on how to run the test case.
242
243   You also have to explain what is wrong; if you get a crash, or if the
244results printed are incorrect and in that case, in what way.
245
246   Please include compiler version information in your bug report.  This
247can be extracted using 'gcc -v', or 'cc -V' on some machines.  Also,
248include the output from 'uname -a'.
249
250   If your bug report is good, we will do our best to help you to get a
251corrected version of the library; if the bug report is poor, we will not
252do anything about it (aside of chiding you to send better bug reports).
253
254   Send your bug report to: 'mpc-discuss@lists.gforge.inria.fr'.
255
256   If you think something in this manual is unclear, or downright
257incorrect, or if the language needs to be improved, please send a note
258to the same address.
259
260
261File: mpc.info,  Node: GNU MPC Basics,  Next: Complex Functions,  Prev: Reporting Bugs,  Up: Top
262
2634 GNU MPC Basics
264****************
265
266All declarations needed to use GNU MPC are collected in the include file
267'mpc.h'.  It is designed to work with both C and C++ compilers.  You
268should include that file in any program using the GNU MPC library by
269adding the line
270        #include "mpc.h"
271
2724.1 Nomenclature and Types
273==========================
274
275"Complex number" or "Complex" for short, is a pair of two arbitrary
276precision floating-point numbers (for the real and imaginary parts).
277The C data type for such objects is 'mpc_t'.
278
279The "Precision" is the number of bits used to represent the mantissa of
280the real and imaginary parts; the corresponding C data type is
281'mpfr_prec_t'.  For more details on the allowed precision range, *note
282(mpfr.info)Nomenclature and Types::.
283
284The "rounding mode" specifies the way to round the result of a complex
285operation, in case the exact result can not be represented exactly in
286the destination mantissa; the corresponding C data type is 'mpc_rnd_t'.
287A complex rounding mode is a pair of two rounding modes: one for the
288real part, one for the imaginary part.
289
2904.2 Function Classes
291====================
292
293There is only one class of functions in the GNU MPC library, namely
294functions for complex arithmetic.  The function names begin with 'mpc_'.
295The associated type is 'mpc_t'.
296
2974.3 GNU MPC Variable Conventions
298================================
299
300As a general rule, all GNU MPC functions expect output arguments before
301input arguments.  This notation is based on an analogy with the
302assignment operator.
303
304   GNU MPC allows you to use the same variable for both input and output
305in the same expression.  For example, the main function for
306floating-point multiplication, 'mpc_mul', can be used like this:
307'mpc_mul (x, x, x, rnd_mode)'.  This computes the square of X with
308rounding mode 'rnd_mode' and puts the result back in X.
309
310   Before you can assign to an GNU MPC variable, you need to initialise
311it by calling one of the special initialization functions.  When you are
312done with a variable, you need to clear it out, using one of the
313functions for that purpose.
314
315   A variable should only be initialised once, or at least cleared out
316between each initialization.  After a variable has been initialised, it
317may be assigned to any number of times.
318
319   For efficiency reasons, avoid to initialise and clear out a variable
320in loops.  Instead, initialise it before entering the loop, and clear it
321out after the loop has exited.
322
323   You do not need to be concerned about allocating additional space for
324GNU MPC variables, since each of its real and imaginary part has a
325mantissa of fixed size.  Hence unless you change its precision, or clear
326and reinitialise it, a complex variable will have the same allocated
327space during all its life.
328
3294.4 Rounding Modes
330==================
331
332A complex rounding mode is of the form 'MPC_RNDxy' where 'x' and 'y' are
333one of 'N' (to nearest), 'Z' (towards zero), 'U' (towards plus
334infinity), 'D' (towards minus infinity).  The first letter refers to the
335rounding mode for the real part, and the second one for the imaginary
336part.  For example 'MPC_RNDZU' indicates to round the real part towards
337zero, and the imaginary part towards plus infinity.
338
339   The 'round to nearest' mode works as in the IEEE P754 standard: in
340case the number to be rounded lies exactly in the middle of two
341representable numbers, it is rounded to the one with the least
342significant bit set to zero.  For example, the number 5, which is
343represented by (101) in binary, is rounded to (100)=4 with a precision
344of two bits, and not to (110)=6.
345
3464.5 Return Value
347================
348
349Most GNU MPC functions have a return value of type 'int', which is used
350to indicate the position of the rounded real and imaginary parts with
351respect to the exact (infinite precision) values.  If this integer is
352'i', the macros 'MPC_INEX_RE(i)' and 'MPC_INEX_IM(i)' give 0 if the
353corresponding rounded value is exact, a negative value if the rounded
354value is less than the exact one, and a positive value if it is greater
355than the exact one.  Similarly, functions computing a result of type
356'mpfr_t' return an integer that is 0, positive or negative depending on
357whether the rounded value is the same, larger or smaller then the exact
358result.
359
360   Some functions, such as 'mpc_sin_cos', compute two complex results;
361the macros 'MPC_INEX1(i)' and 'MPC_INEX2(i)', applied to the return
362value 'i' of such a function, yield the exactness value corresponding to
363the first or the second computed value, respectively.
364
3654.6 Branch Cuts And Special Values
366==================================
367
368Some complex functions have branch cuts, across which the function is
369discontinous.  In GNU MPC, the branch cuts chosen are the same as those
370specified for the corresponding functions in the ISO C99 standard.
371
372   Likewise, when evaluated at a point whose real or imaginary part is
373either infinite or a NaN or a signed zero, a function returns the same
374value as those specified for the corresponding function in the ISO C99
375standard.
376
377
378File: mpc.info,  Node: Complex Functions,  Next: References,  Prev: GNU MPC Basics,  Up: Top
379
3805 Complex Functions
381*******************
382
383The complex functions expect arguments of type 'mpc_t'.
384
385   The GNU MPC floating-point functions have an interface that is
386similar to the GNU MP integer functions.  The function prefix for
387operations on complex numbers is 'mpc_'.
388
389   The precision of a computation is defined as follows: Compute the
390requested operation exactly (with "infinite precision"), and round the
391result to the destination variable precision with the given rounding
392mode.
393
394   The GNU MPC complex functions are intended to be a smooth extension
395of the IEEE P754 arithmetic.  The results obtained on one computer
396should not differ from the results obtained on a computer with a
397different word size.
398
399* Menu:
400
401* Initializing Complex Numbers::
402* Assigning Complex Numbers::
403* Converting Complex Numbers::
404* String and Stream Input and Output::
405* Complex Comparison::
406* Projection & Decomposing::
407* Basic Arithmetic::
408* Power Functions and Logarithm::
409* Trigonometric Functions::
410* Miscellaneous Complex Functions::
411* Advanced Functions::
412* Internals::
413
414
415File: mpc.info,  Node: Initializing Complex Numbers,  Next: Assigning Complex Numbers,  Up: Complex Functions
416
4175.1 Initialization Functions
418============================
419
420An 'mpc_t' object must be initialised before storing the first value in
421it.  The functions 'mpc_init2' and 'mpc_init3' are used for that
422purpose.
423
424 -- Function: void mpc_init2 (mpc_t Z, mpfr_prec_t PREC)
425     Initialise Z to precision PREC bits and set its real and imaginary
426     parts to NaN. Normally, a variable should be initialised once only
427     or at least be cleared, using 'mpc_clear', between initializations.
428
429 -- Function: void mpc_init3 (mpc_t Z, mpfr_prec_t PREC_R, mpfr_prec_t
430          PREC_I)
431     Initialise Z with the precision of its real part being PREC_R bits
432     and the precision of its imaginary part being PREC_I bits, and set
433     the real and imaginary parts to NaN.
434
435 -- Function: void mpc_clear (mpc_t Z)
436     Free the space occupied by Z.  Make sure to call this function for
437     all 'mpc_t' variables when you are done with them.
438
439   Here is an example on how to initialise complex variables:
440     {
441       mpc_t x, y;
442       mpc_init2 (x, 256);		/* precision _exactly_ 256 bits */
443       mpc_init3 (y, 100, 50);	/* 100/50 bits for the real/imaginary part */
444       ...
445       mpc_clear (x);
446       mpc_clear (y);
447     }
448
449   The following function is useful for changing the precision during a
450calculation.  A typical use would be for adjusting the precision
451gradually in iterative algorithms like Newton-Raphson, making the
452computation precision closely match the actual accurate part of the
453numbers.
454
455 -- Function: void mpc_set_prec (mpc_t X, mpfr_prec_t PREC)
456     Reset the precision of X to be *exactly* PREC bits, and set its
457     real/imaginary parts to NaN. The previous value stored in X is
458     lost.  It is equivalent to a call to 'mpc_clear(x)' followed by a
459     call to 'mpc_init2(x, prec)', but more efficient as no allocation
460     is done in case the current allocated space for the mantissa of X
461     is sufficient.
462
463 -- Function: mpfr_prec_t mpc_get_prec (const mpc_t X)
464     If the real and imaginary part of X have the same precision, it is
465     returned, otherwise, 0 is returned.
466
467 -- Function: void mpc_get_prec2 (mpfr_prec_t* PR, mpfr_prec_t* PI,
468          const mpc_t X)
469     Returns the precision of the real part of X via PR and of its
470     imaginary part via PI.
471
472
473File: mpc.info,  Node: Assigning Complex Numbers,  Next: Converting Complex Numbers,  Prev: Initializing Complex Numbers,  Up: Complex Functions
474
4755.2 Assignment Functions
476========================
477
478These functions assign new values to already initialised complex numbers
479(*note Initializing Complex Numbers::).  When using any functions with
480'intmax_t' or 'uintmax_t' parameters, you must include '<stdint.h>' or
481'<inttypes.h>' _before_ 'mpc.h', to allow 'mpc.h' to define prototypes
482for these functions.  Similarly, functions with parameters of type
483'complex' or 'long complex' are defined only if '<complex.h>' is
484included _before_ 'mpc.h'.  If you need assignment functions that are
485not in the current API, you can define them using the 'MPC_SET_X_Y'
486macro (*note Advanced Functions::).
487
488 -- Function: int mpc_set (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
489     Set the value of ROP from OP, rounded to the precision of ROP with
490     the given rounding mode RND.
491
492 -- Function: int mpc_set_ui (mpc_t ROP, unsigned long int OP, mpc_rnd_t
493          RND)
494 -- Function: int mpc_set_si (mpc_t ROP, long int OP, mpc_rnd_t RND)
495 -- Function: int mpc_set_uj (mpc_t ROP, uintmax_t OP, mpc_rnd_t RND)
496 -- Function: int mpc_set_sj (mpc_t ROP, intmax_t OP, mpc_rnd_t RND)
497 -- Function: int mpc_set_d (mpc_t ROP, double OP, mpc_rnd_t RND)
498 -- Function: int mpc_set_ld (mpc_t ROP, long double OP, mpc_rnd_t RND)
499 -- Function: int mpc_set_dc (mpc_t ROP, double _Complex OP, mpc_rnd_t
500          RND)
501 -- Function: int mpc_set_ldc (mpc_t ROP, long double _Complex OP,
502          mpc_rnd_t RND)
503 -- Function: int mpc_set_z (mpc_t ROP, const mpz_t OP mpc_rnd_t RND)
504 -- Function: int mpc_set_q (mpc_t ROP, const mpq_t OP mpc_rnd_t RND)
505 -- Function: int mpc_set_f (mpc_t ROP, const mpf_t OP mpc_rnd_t RND)
506 -- Function: int mpc_set_fr (mpc_t ROP, const mpfr_t OP, mpc_rnd_t RND)
507     Set the value of ROP from OP, rounded to the precision of ROP with
508     the given rounding mode RND.  The argument OP is interpreted as
509     real, so the imaginary part of ROP is set to zero with a positive
510     sign.  Please note that even a 'long int' may have to be rounded,
511     if the destination precision is less than the machine word width.
512     For 'mpc_set_d', be careful that the input number OP may not be
513     exactly representable as a double-precision number (this happens
514     for 0.1 for instance), in which case it is first rounded by the C
515     compiler to a double-precision number, and then only to a complex
516     number.
517
518 -- Function: int mpc_set_ui_ui (mpc_t ROP, unsigned long int OP1,
519          unsigned long int OP2, mpc_rnd_t RND)
520 -- Function: int mpc_set_si_si (mpc_t ROP, long int OP1, long int OP2,
521          mpc_rnd_t RND)
522 -- Function: int mpc_set_uj_uj (mpc_t ROP, uintmax_t OP1, uintmax_t
523          OP2, mpc_rnd_t RND)
524 -- Function: int mpc_set_sj_sj (mpc_t ROP, intmax_t OP1, intmax_t OP2,
525          mpc_rnd_t RND)
526 -- Function: int mpc_set_d_d (mpc_t ROP, double OP1, double OP2,
527          mpc_rnd_t RND)
528 -- Function: int mpc_set_ld_ld (mpc_t ROP, long double OP1, long double
529          OP2, mpc_rnd_t RND)
530 -- Function: int mpc_set_z_z (mpc_t ROP, const mpz_t OP1, const mpz_t
531          OP2, mpc_rnd_t RND)
532 -- Function: int mpc_set_q_q (mpc_t ROP, const mpq_t OP1, const mpq_t
533          OP2, mpc_rnd_t RND)
534 -- Function: int mpc_set_f_f (mpc_t ROP, const mpf_t OP1, const mpf_t
535          OP2, mpc_rnd_t RND)
536 -- Function: int mpc_set_fr_fr (mpc_t ROP, const mpfr_t OP1, const
537          mpfr_t OP2, mpc_rnd_t RND)
538     Set the real part of ROP from OP1, and its imaginary part from OP2,
539     according to the rounding mode RND.
540
541     Beware that the behaviour of 'mpc_set_fr_fr' is undefined if OP1 or
542     OP2 is a pointer to the real or imaginary part of ROP.  To exchange
543     the real and the imaginary part of a complex number, either use
544     'mpfr_swap (mpc_realref (rop), mpc_imagref (rop))', which also
545     exchanges the precisions of the two parts; or use a temporary
546     variable.
547
548   For functions assigning complex variables from strings or input
549streams, *note String and Stream Input and Output::.
550
551 -- Function: void mpc_set_nan (mpc_t ROP)
552     Set ROP to Nan+i*NaN.
553
554 -- Function: void mpc_swap (mpc_t OP1, mpc_t OP2)
555     Swap the values of OP1 and OP2 efficiently.  Warning: The
556     precisions are exchanged, too; in case these are different,
557     'mpc_swap' is thus not equivalent to three 'mpc_set' calls using a
558     third auxiliary variable.
559
560
561File: mpc.info,  Node: Converting Complex Numbers,  Next: String and Stream Input and Output,  Prev: Assigning Complex Numbers,  Up: Complex Functions
562
5635.3 Conversion Functions
564========================
565
566The following functions are available only if '<complex.h>' is included
567_before_ 'mpc.h'.
568
569 -- Function: double _Complex mpc_get_dc (const mpc_t OP, mpc_rnd_t RND)
570 -- Function: long double _Complex mpc_get_ldc (mpc_t OP, mpc_rnd_t RND)
571     Convert OP to a C complex number, using the rounding mode RND.
572
573   For functions converting complex variables to strings or stream
574output, *note String and Stream Input and Output::.
575
576
577File: mpc.info,  Node: String and Stream Input and Output,  Next: Complex Comparison,  Prev: Converting Complex Numbers,  Up: Complex Functions
578
5795.4 String and Stream Input and Output
580======================================
581
582 -- Function: int mpc_strtoc (mpc_t ROP, const char *NPTR, char
583          **ENDPTR, int BASE, mpc_rnd_t RND)
584     Read a complex number from a string NPTR in base BASE, rounded to
585     the precision of ROP with the given rounding mode RND.  The BASE
586     must be either 0 or a number from 2 to 36 (otherwise the behaviour
587     is undefined).  If NPTR starts with valid data, the result is
588     stored in ROP, the usual inexact value is returned (*note Return
589     Value: return-value.) and, if ENDPTR is not the null pointer,
590     *ENDPTR points to the character just after the valid data.
591     Otherwise, ROP is set to 'NaN + i * NaN', -1 is returned and, if
592     ENDPTR is not the null pointer, the value of NPTR is stored in the
593     location referenced by ENDPTR.
594
595     The expected form of a complex number string is either a real
596     number (an optional leading whitespace, an optional sign followed
597     by a floating-point number), or a pair of real numbers in
598     parentheses separated by whitespace.  If a real number is read, the
599     missing imaginary part is set to +0.  The form of a floating-point
600     number depends on the base and is described in the documentation of
601     'mpfr_strtofr' (*note (mpfr.info)Assignment Functions::).  For
602     instance, '"3.1415926"', '"(1.25e+7 +.17)"', '"(@nan@ 2)"' and
603     '"(-0 -7)"' are valid strings for BASE = 10.  If BASE = 0, then a
604     prefix may be used to indicate the base in which the floating-point
605     number is written.  Use prefix '0b' for binary numbers, prefix '0x'
606     for hexadecimal numbers, and no prefix for decimal numbers.  The
607     real and imaginary part may then be written in different bases.
608     For instance, '"(1.024e+3 +2.05e+3)"' and '"(0b1p+10 +0x802)"' are
609     valid strings for 'base'=0 and represent the same value.
610
611 -- Function: int mpc_set_str (mpc_t ROP, const char *S, int BASE,
612          mpc_rnd_t rnd)
613     Set ROP to the value of the string S in base BASE, rounded to the
614     precision of ROP with the given rounding mode RND.  See the
615     documentation of 'mpc_strtoc' for a detailed description of the
616     valid string formats.  Contrarily to 'mpc_strtoc', 'mpc_set_str'
617     requires the _whole_ string to represent a valid complex number
618     (potentially followed by additional white space).  This function
619     returns the usual inexact value (*note Return Value: return-value.)
620     if the entire string up to the final null character is a valid
621     number in base BASE; otherwise it returns -1, and ROP is set to
622     NaN+i*NaN.
623
624 -- Function: char * mpc_get_str (int B, size_t N, const mpc_t OP,
625          mpc_rnd_t RND)
626     Convert OP to a string containing its real and imaginary parts,
627     separated by a space and enclosed in a pair of parentheses.  The
628     numbers are written in base B (which may vary from 2 to 36) and
629     rounded according to RND.  The number of significant digits, at
630     least 2, is given by N.  It is also possible to let N be zero, in
631     which case the number of digits is chosen large enough so that
632     re-reading the printed value with the same precision, assuming both
633     output and input use rounding to nearest, will recover the original
634     value of OP.  Note that 'mpc_get_str' uses the decimal point of the
635     current locale if available, and '.' otherwise.
636
637     The string is generated using the current memory allocation
638     function ('malloc' by default, unless it has been modified using
639     the custom memory allocation interface of 'gmp'); once it is not
640     needed any more, it should be freed by calling 'mpc_free_str'.
641
642 -- Function: void mpc_free_str (char *STR)
643     Free the string STR, which needs to have been allocated by a call
644     to 'mpc_get_str'.
645
646   The following two functions read numbers from input streams and write
647them to output streams.  When using any of these functions, you need to
648include 'stdio.h' _before_ 'mpc.h'.
649
650 -- Function: int mpc_inp_str (mpc_t ROP, FILE *STREAM, size_t *READ,
651          int BASE, mpc_rnd_t RND)
652     Input a string in base BASE in the same format as for 'mpc_strtoc'
653     from stdio stream STREAM, rounded according to RND, and put the
654     read complex number into ROP.  If STREAM is the null pointer, ROP
655     is read from 'stdin'.  Return the usual inexact value; if an error
656     occurs, set ROP to 'NaN + i * NaN' and return -1.  If READ is not
657     the null pointer, it is set to the number of read characters.
658
659     Unlike 'mpc_strtoc', the function 'mpc_inp_str' does not possess
660     perfect knowledge of the string to transform and has to read it
661     character by character, so it behaves slightly differently: It
662     tries to read a string describing a complex number and processes
663     this string through a call to 'mpc_set_str'.  Precisely, after
664     skipping optional whitespace, a minimal string is read according to
665     the regular expression 'mpfr | '(' \s* mpfr \s+ mpfr \s* ')'',
666     where '\s' denotes a whitespace, and 'mpfr' is either a string
667     containing neither whitespaces nor parentheses, or
668     'nan(n-char-sequence)' or '@nan@(n-char-sequence)' (regardless of
669     capitalisation) with 'n-char-sequence' a string of ascii letters,
670     digits or ''_''.
671
672     For instance, upon input of '"nan(13 1)"', the function
673     'mpc_inp_str' starts to recognise a value of NaN followed by an
674     n-char-sequence indicated by the opening parenthesis; as soon as
675     the space is reached, it becomes clear that the expression in
676     parentheses is not an n-char-sequence, and the error flag -1 is
677     returned after 6 characters have been consumed from the stream (the
678     whitespace itself remaining in the stream).  The function
679     'mpc_strtoc', on the other hand, may track back when reaching the
680     whitespace; it treats the string as the two successive complex
681     numbers 'NaN + i * 0' and '13 + i'.  It is thus recommended to have
682     a whitespace follow each floating point number to avoid this
683     problem.
684
685 -- Function: size_t mpc_out_str (FILE *STREAM, int BASE, size_t
686          N_DIGITS, const mpc_t OP, mpc_rnd_t RND)
687     Output OP on stdio stream STREAM in base BASE, rounded according to
688     RND, in the same format as for 'mpc_strtoc' If STREAM is the null
689     pointer, ROP is written to 'stdout'.
690
691     Return the number of characters written.
692
693
694File: mpc.info,  Node: Complex Comparison,  Next: Projection & Decomposing,  Prev: String and Stream Input and Output,  Up: Complex Functions
695
6965.5 Comparison Functions
697========================
698
699 -- Function: int mpc_cmp (const mpc_t OP1, const mpc_t OP2)
700 -- Function: int mpc_cmp_si_si (const mpc_t OP1, long int OP2R, long
701          int OP2I)
702 -- Macro: int mpc_cmp_si (mpc_t OP1, long int OP2)
703
704     Compare OP1 and OP2, where in the case of 'mpc_cmp_si_si', OP2 is
705     taken to be OP2R + i OP2I.  The return value C can be decomposed
706     into 'x = MPC_INEX_RE(c)' and 'y = MPC_INEX_IM(c)', such that X is
707     positive if the real part of OP1 is greater than that of OP2, zero
708     if both real parts are equal, and negative if the real part of OP1
709     is less than that of OP2, and likewise for Y.  Both OP1 and OP2 are
710     considered to their full own precision, which may differ.  It is
711     not allowed that one of the operands has a NaN (Not-a-Number) part.
712
713     The storage of the return value is such that equality can be simply
714     checked with 'mpc_cmp (op1, op2) == 0'.
715
716 -- Function: int mpc_cmp_abs (const mpc_t OP1, const mpc_t OP2)
717
718     Compare the absolute values of OP1 and OP2.  The return value is 0
719     if both are the same (including infinity), positive if the absolute
720     value of OP1 is greater than that of OP2, and negative if it is
721     smaller.  If OP1 or OP2 has a real or imaginary part which is NaN,
722     the function behaves like 'mpfr_cmp' on two real numbers of which
723     at least one is NaN.
724
725
726File: mpc.info,  Node: Projection & Decomposing,  Next: Basic Arithmetic,  Prev: Complex Comparison,  Up: Complex Functions
727
7285.6 Projection and Decomposing Functions
729========================================
730
731 -- Function: int mpc_real (mpfr_t ROP, const mpc_t OP, mpfr_rnd_t RND)
732     Set ROP to the value of the real part of OP rounded in the
733     direction RND.
734
735 -- Function: int mpc_imag (mpfr_t ROP, const mpc_t OP, mpfr_rnd_t RND)
736     Set ROP to the value of the imaginary part of OP rounded in the
737     direction RND.
738
739 -- Macro: mpfr_t mpc_realref (mpc_t OP)
740 -- Macro: mpfr_t mpc_imagref (mpc_t OP)
741     Return a reference to the real part and imaginary part of OP,
742     respectively.  The 'mpfr' functions can be used on the result of
743     these macros (note that the 'mpfr_t' type is itself a pointer).
744
745 -- Function: int mpc_arg (mpfr_t ROP, const mpc_t OP, mpfr_rnd_t RND)
746     Set ROP to the argument of OP, with a branch cut along the negative
747     real axis.
748
749 -- Function: int mpc_proj (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
750     Compute a projection of OP onto the Riemann sphere.  Set ROP to OP
751     rounded in the direction RND, except when at least one part of OP
752     is infinite (even if the other part is a NaN) in which case the
753     real part of ROP is set to plus infinity and its imaginary part to
754     a signed zero with the same sign as the imaginary part of OP.
755
756
757File: mpc.info,  Node: Basic Arithmetic,  Next: Power Functions and Logarithm,  Prev: Projection & Decomposing,  Up: Complex Functions
758
7595.7 Basic Arithmetic Functions
760==============================
761
762All the following functions are designed in such a way that, when
763working with real numbers instead of complex numbers, their complexity
764should essentially be the same as with the GNU MPFR library, with only a
765marginal overhead due to the GNU MPC layer.
766
767 -- Function: int mpc_add (mpc_t ROP, const mpc_t OP1, const mpc_t OP2,
768          mpc_rnd_t RND)
769 -- Function: int mpc_add_ui (mpc_t ROP, const mpc_t OP1, unsigned long
770          int OP2, mpc_rnd_t RND)
771 -- Function: int mpc_add_fr (mpc_t ROP, const mpc_t OP1, const mpfr_t
772          OP2, mpc_rnd_t RND)
773     Set ROP to OP1 + OP2 rounded according to RND.
774
775 -- Function: int mpc_sub (mpc_t ROP, const mpc_t OP1, const mpc_t OP2,
776          mpc_rnd_t RND)
777 -- Function: int mpc_sub_fr (mpc_t ROP, const mpc_t OP1, const mpfr_t
778          OP2, mpc_rnd_t RND)
779 -- Function: int mpc_fr_sub (mpc_t ROP, const mpfr_t OP1, const mpc_t
780          OP2, mpc_rnd_t RND)
781 -- Function: int mpc_sub_ui (mpc_t ROP, const mpc_t OP1, unsigned long
782          int OP2, mpc_rnd_t RND)
783 -- Macro: int mpc_ui_sub (mpc_t ROP, unsigned long int OP1, const mpc_t
784          OP2, mpc_rnd_t RND)
785 -- Function: int mpc_ui_ui_sub (mpc_t ROP, unsigned long int RE1,
786          unsigned long int IM1, mpc_t OP2, mpc_rnd_t RND)
787     Set ROP to OP1 - OP2 rounded according to RND.  For
788     'mpc_ui_ui_sub', OP1 is RE1 + IM1.
789
790 -- Function: int mpc_neg (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
791     Set ROP to -OP rounded according to RND.  Just changes the sign if
792     ROP and OP are the same variable.
793
794 -- Function: int mpc_sum (mpc_t ROP, const mpc_ptr* OP, unsigned long
795          N, mpc_rnd_t RND)
796     Set ROP to the sum of the elements in the array OP of length N,
797     rounded according to RND.
798
799 -- Function: int mpc_mul (mpc_t ROP, const mpc_t OP1, const mpc_t OP2,
800          mpc_rnd_t RND)
801 -- Function: int mpc_mul_ui (mpc_t ROP, const mpc_t OP1, unsigned long
802          int OP2, mpc_rnd_t RND)
803 -- Function: int mpc_mul_si (mpc_t ROP, const mpc_t OP1, long int OP2,
804          mpc_rnd_t RND)
805 -- Function: int mpc_mul_fr (mpc_t ROP, const mpc_t OP1, const mpfr_t
806          OP2, mpc_rnd_t RND)
807     Set ROP to OP1 times OP2 rounded according to RND.  Note: for
808     'mpc_mul', in case OP1 and OP2 have the same value, use 'mpc_sqr'
809     for better efficiency.
810
811 -- Function: int mpc_mul_i (mpc_t ROP, const mpc_t OP, int SGN,
812          mpc_rnd_t RND)
813     Set ROP to OP times the imaginary unit i if SGN is non-negative,
814     set ROP to OP times -i otherwise, in both cases rounded according
815     to RND.
816
817 -- Function: int mpc_sqr (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
818     Set ROP to the square of OP rounded according to RND.
819
820 -- Function: int mpc_fma (mpc_t ROP, const mpc_t OP1, const mpc_t OP2,
821          const mpc_t OP3, mpc_rnd_t RND)
822     Set ROP to OP1*OP2+OP3, rounded according to RND, with only one
823     final rounding.
824
825 -- Function: int mpc_dot (mpc_t ROP, const mpc_ptr* OP1, mpc_ptr* OP2,
826          unsigned long N, mpc_rnd_t RND)
827     Set ROP to the dot product of the elements in the arrays OP1 and
828     OP2, both of length N, rounded according to RND.
829
830 -- Function: int mpc_div (mpc_t ROP, const mpc_t OP1, const mpc_t OP2,
831          mpc_rnd_t RND)
832 -- Function: int mpc_div_ui (mpc_t ROP, const mpc_t OP1, unsigned long
833          int OP2, mpc_rnd_t RND)
834 -- Function: int mpc_div_fr (mpc_t ROP, const mpc_t OP1, const mpfr_t
835          OP2, mpc_rnd_t RND)
836 -- Function: int mpc_ui_div (mpc_t ROP, unsigned long int OP1, const
837          mpc_t OP2, mpc_rnd_t RND)
838 -- Function: int mpc_fr_div (mpc_t ROP, const mpfr_t OP1, const mpc_t
839          OP2, mpc_rnd_t RND)
840     Set ROP to OP1/OP2 rounded according to RND.
841
842 -- Function: int mpc_conj (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
843     Set ROP to the conjugate of OP rounded according to RND.  Just
844     changes the sign of the imaginary part if ROP and OP are the same
845     variable.
846
847 -- Function: int mpc_abs (mpfr_t ROP, const mpc_t OP, mpfr_rnd_t RND)
848     Set the floating-point number ROP to the absolute value of OP,
849     rounded in the direction RND.
850
851 -- Function: int mpc_norm (mpfr_t ROP, const mpc_t OP, mpfr_rnd_t RND)
852     Set the floating-point number ROP to the norm of OP (i.e., the
853     square of its absolute value), rounded in the direction RND.
854
855 -- Function: int mpc_mul_2ui (mpc_t ROP, const mpc_t OP1, unsigned long
856          int OP2, mpc_rnd_t RND)
857 -- Function: int mpc_mul_2si (mpc_t ROP, const mpc_t OP1, long int OP2,
858          mpc_rnd_t RND)
859     Set ROP to OP1 times 2 raised to OP2 rounded according to RND.
860     Just modifies the exponents of the real and imaginary parts by OP2
861     when ROP and OP1 are identical.
862
863 -- Function: int mpc_div_2ui (mpc_t ROP, const mpc_t OP1, unsigned long
864          int OP2, mpc_rnd_t RND)
865 -- Function: int mpc_div_2si (mpc_t ROP, const mpc_t OP1, long int OP2,
866          mpc_rnd_t RND)
867     Set ROP to OP1 divided by 2 raised to OP2 rounded according to RND.
868     Just modifies the exponents of the real and imaginary parts by OP2
869     when ROP and OP1 are identical.
870
871
872File: mpc.info,  Node: Power Functions and Logarithm,  Next: Trigonometric Functions,  Prev: Basic Arithmetic,  Up: Complex Functions
873
8745.8 Power Functions and Logarithm
875=================================
876
877 -- Function: int mpc_sqrt (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
878     Set ROP to the square root of OP rounded according to RND.  The
879     returned value ROP has a non-negative real part, and if its real
880     part is zero, a non-negative imaginary part.
881
882 -- Function: int mpc_pow (mpc_t ROP, const mpc_t OP1, const mpc_t OP2,
883          mpc_rnd_t RND)
884 -- Function: int mpc_pow_d (mpc_t ROP, const mpc_t OP1, double OP2,
885          mpc_rnd_t RND)
886 -- Function: int mpc_pow_ld (mpc_t ROP, const mpc_t OP1, long double
887          OP2, mpc_rnd_t RND)
888 -- Function: int mpc_pow_si (mpc_t ROP, const mpc_t OP1, long OP2,
889          mpc_rnd_t RND)
890 -- Function: int mpc_pow_ui (mpc_t ROP, const mpc_t OP1, unsigned long
891          OP2, mpc_rnd_t RND)
892 -- Function: int mpc_pow_z (mpc_t ROP, const mpc_t OP1, const mpz_t
893          OP2, mpc_rnd_t RND)
894 -- Function: int mpc_pow_fr (mpc_t ROP, const mpc_t OP1, const mpfr_t
895          OP2, mpc_rnd_t RND)
896     Set ROP to OP1 raised to the power OP2, rounded according to RND.
897     For 'mpc_pow_d', 'mpc_pow_ld', 'mpc_pow_si', 'mpc_pow_ui',
898     'mpc_pow_z' and 'mpc_pow_fr', the imaginary part of OP2 is
899     considered as +0.  When both OP1 and OP2 are zero, the result has
900     real part 1, and imaginary part 0, with sign being the opposite of
901     that of OP2.
902
903 -- Function: int mpc_exp (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
904     Set ROP to the exponential of OP, rounded according to RND with the
905     precision of ROP.
906
907 -- Function: int mpc_log (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
908 -- Function: int mpc_log10 (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
909     Set ROP to the natural and base-10 logarithm of OP respectively,
910     rounded according to RND with the precision of ROP.  The principal
911     branch is chosen, with the branch cut on the negative real axis, so
912     that the imaginary part of the result lies in ]-Pi , Pi] and
913     ]-Pi/log(10) , Pi/log(10)] respectively.
914
915 -- Function: int mpc_rootofunity (mpc_t ROP, unsigned long int N,
916          unsigned long int K, mpc_rnd_t RND)
917     Set ROP to the standard primitive N-th root of unity raised to the
918     power K, that is, exp (2 Pi i k / n), rounded according to RND with
919     the precision of ROP.
920
921
922File: mpc.info,  Node: Trigonometric Functions,  Next: Miscellaneous Complex Functions,  Prev: Power Functions and Logarithm,  Up: Complex Functions
923
9245.9 Trigonometric Functions
925===========================
926
927 -- Function: int mpc_sin (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
928 -- Function: int mpc_cos (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
929 -- Function: int mpc_tan (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
930     Set ROP to the sine, cosine, tangent of OP, rounded according to
931     RND with the precision of ROP.
932
933 -- Function: int mpc_sin_cos (mpc_t ROP_SIN, mpc_t ROP_COS, const mpc_t
934          OP, mpc_rnd_t RND_SIN, mpc_rnd_t RND_COS)
935     Set ROP_SIN to the sine of OP, rounded according to RND_SIN with
936     the precision of ROP_SIN, and ROP_COS to the cosine of OP, rounded
937     according to RND_COS with the precision of ROP_COS.
938
939 -- Function: int mpc_sinh (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
940 -- Function: int mpc_cosh (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
941 -- Function: int mpc_tanh (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
942     Set ROP to the hyperbolic sine, hyperbolic cosine, hyperbolic
943     tangent of OP, rounded according to RND with the precision of ROP.
944
945 -- Function: int mpc_asin (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
946 -- Function: int mpc_acos (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
947 -- Function: int mpc_atan (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
948     Set ROP to the inverse sine, inverse cosine, inverse tangent of OP,
949     rounded according to RND with the precision of ROP.
950
951 -- Function: int mpc_asinh (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
952 -- Function: int mpc_acosh (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
953 -- Function: int mpc_atanh (mpc_t ROP, const mpc_t OP, mpc_rnd_t RND)
954     Set ROP to the inverse hyperbolic sine, inverse hyperbolic cosine,
955     inverse hyperbolic tangent of OP, rounded according to RND with the
956     precision of ROP.  The branch cut of 'mpc_acosh' is (-Inf, 1)
957
958
959File: mpc.info,  Node: Miscellaneous Complex Functions,  Next: Advanced Functions,  Prev: Trigonometric Functions,  Up: Complex Functions
960
9615.10 Miscellaneous Functions
962============================
963
964 -- Function: int mpc_urandom (mpc_t ROP, gmp_randstate_t STATE)
965     Generate a uniformly distributed random complex in the unit square
966     [0, 1] x [0, 1].  Return 0, unless an exponent in the real or
967     imaginary part is not in the current exponent range, in which case
968     that part is set to NaN and a zero value is returned.  The second
969     argument is a 'gmp_randstate_t' structure which should be created
970     using the GMP 'rand_init' function, see the GMP manual.
971
972 -- Function: const char * mpc_get_version (void)
973     Return the GNU MPC version, as a null-terminated string.
974
975 -- Macro: MPC_VERSION
976 -- Macro: MPC_VERSION_MAJOR
977 -- Macro: MPC_VERSION_MINOR
978 -- Macro: MPC_VERSION_PATCHLEVEL
979 -- Macro: MPC_VERSION_STRING
980     'MPC_VERSION' is the version of GNU MPC as a preprocessing
981     constant.  'MPC_VERSION_MAJOR', 'MPC_VERSION_MINOR' and
982     'MPC_VERSION_PATCHLEVEL' are respectively the major, minor and
983     patch level of GNU MPC version, as preprocessing constants.
984     'MPC_VERSION_STRING' is the version as a string constant, which can
985     be compared to the result of 'mpc_get_version' to check at run time
986     the header file and library used match:
987          if (strcmp (mpc_get_version (), MPC_VERSION_STRING))
988            fprintf (stderr, "Warning: header and library do not match\n");
989     Note: Obtaining different strings is not necessarily an error, as
990     in general, a program compiled with some old GNU MPC version can be
991     dynamically linked with a newer GNU MPC library version (if allowed
992     by the library versioning system).
993
994 -- Macro: long MPC_VERSION_NUM (MAJOR, MINOR, PATCHLEVEL)
995     Create an integer in the same format as used by 'MPC_VERSION' from
996     the given MAJOR, MINOR and PATCHLEVEL.  Here is an example of how
997     to check the GNU MPC version at compile time:
998          #if (!defined(MPC_VERSION) || (MPC_VERSION<MPC_VERSION_NUM(2,1,0)))
999          # error "Wrong GNU MPC version."
1000          #endif
1001
1002
1003File: mpc.info,  Node: Advanced Functions,  Next: Internals,  Prev: Miscellaneous Complex Functions,  Up: Complex Functions
1004
10055.11 Advanced Functions
1006=======================
1007
1008 -- Macro: MPC_SET_X_Y (REAL_SUFFIX, IMAG_SUFFIX, ROP, REAL, IMAG, RND)
1009     The macro MPC_SET_X_Y is designed to serve as the body of an
1010     assignment function and cannot be used by itself.  The REAL_SUFFIX
1011     and IMAG_SUFFIX parameters are the types of the real and imaginary
1012     part, that is, the 'x' in the 'mpfr_set_x' function one would use
1013     to set the part; for the mpfr type, use 'fr'.  REAL (respectively
1014     IMAG) is the value you want to assign to the real (resp.
1015     imaginary) part, its type must conform to REAL_SUFFIX (resp.
1016     IMAG_SUFFIX).  RND is the 'mpc_rnd_t' rounding mode.  The return
1017     value is the usual inexact value (*note Return Value:
1018     return-value.).
1019
1020     For instance, you can define mpc_set_ui_fr as follows:
1021          int mpc_set_ui_fr (mpc_t rop, unsigned long int re, mpfr_t im, mpc_rnd_t rnd)
1022              MPC_SET_X_Y (ui, fr, rop, re, im, rnd);
1023
1024
1025File: mpc.info,  Node: Internals,  Prev: Advanced Functions,  Up: Complex Functions
1026
10275.12 Internals
1028==============
1029
1030These macros and functions are mainly designed for the implementation of
1031GNU MPC, but may be useful for users too.  However, no upward
1032compatibility is guaranteed.  You need to include 'mpc-impl.h' to use
1033them.
1034
1035   The macro 'MPC_MAX_PREC(z)' gives the maximum of the precisions of
1036the real and imaginary parts of a complex number.
1037
1038
1039File: mpc.info,  Node: References,  Next: Concept Index,  Prev: Complex Functions,  Up: Top
1040
1041References
1042**********
1043
1044   * Torbj��rn Granlund et al.  'GMP' - GNU multiprecision library.
1045     Version 6.2.0, <http://gmplib.org>.
1046
1047   * Guillaume Hanrot, Vincent Lef��vre, Patrick P��lissier, Paul
1048     Zimmermann et al.  'MPFR' - A library for multiple-precision
1049     floating-point computations with exact rounding.  Version 4.1.0,
1050     <http://www.mpfr.org>.
1051
1052   * IEEE Standard for Floating-Point Arithmetic, IEEE Computer Society,
1053     IEEE Std 754-2019, Approved 13 June 2019, 84 pages.
1054
1055   * Donald E. Knuth, "The Art of Computer Programming", vol 2,
1056     "Seminumerical Algorithms", 2nd edition, Addison-Wesley, 1981.
1057
1058   * ISO/IEC 9899:1999, Programming languages ��� C.
1059
1060
1061File: mpc.info,  Node: Concept Index,  Next: Function Index,  Prev: References,  Up: Top
1062
1063Concept Index
1064*************
1065
1066[index]
1067* Menu:
1068
1069* Arithmetic functions:                  Basic Arithmetic.     (line  6)
1070* Comparison functions:                  Complex Comparison.   (line  6)
1071* Complex arithmetic functions:          Basic Arithmetic.     (line  6)
1072* Complex assignment functions:          Assigning Complex Numbers.
1073                                                               (line  6)
1074* Complex comparisons functions:         Complex Comparison.   (line  6)
1075* Complex functions:                     Complex Functions.    (line  6)
1076* Complex number:                        GNU MPC Basics.       (line 15)
1077* Conditions for copying GNU MPC:        Copying.              (line  6)
1078* Conversion functions:                  Converting Complex Numbers.
1079                                                               (line  6)
1080* Copying conditions:                    Copying.              (line  6)
1081* Installation:                          Installing GNU MPC.   (line  6)
1082* Logarithm:                             Power Functions and Logarithm.
1083                                                               (line  6)
1084* Miscellaneous complex functions:       Miscellaneous Complex Functions.
1085                                                               (line  6)
1086* mpc.h:                                 GNU MPC Basics.       (line  6)
1087* Power functions:                       Power Functions and Logarithm.
1088                                                               (line  6)
1089* Precision:                             GNU MPC Basics.       (line 19)
1090* Projection and Decomposing Functions:  Projection & Decomposing.
1091                                                               (line  6)
1092* Reporting bugs:                        Reporting Bugs.       (line  6)
1093* Rounding Mode:                         GNU MPC Basics.       (line 24)
1094* String and stream input and output:    String and Stream Input and Output.
1095                                                               (line  6)
1096* Trigonometric functions:               Trigonometric Functions.
1097                                                               (line  6)
1098* User-defined precision:                Complex Functions.    (line 12)
1099
1100
1101File: mpc.info,  Node: Function Index,  Next: GNU Free Documentation License,  Prev: Concept Index,  Up: Top
1102
1103Function Index
1104**************
1105
1106[index]
1107* Menu:
1108
1109* _Complex:                              Converting Complex Numbers.
1110                                                              (line   9)
1111* mpc_abs:                               Basic Arithmetic.    (line  91)
1112* mpc_acos:                              Trigonometric Functions.
1113                                                              (line  25)
1114* mpc_acosh:                             Trigonometric Functions.
1115                                                              (line  31)
1116* mpc_add:                               Basic Arithmetic.    (line  11)
1117* mpc_add_fr:                            Basic Arithmetic.    (line  15)
1118* mpc_add_ui:                            Basic Arithmetic.    (line  13)
1119* mpc_arg:                               Projection & Decomposing.
1120                                                              (line  20)
1121* mpc_asin:                              Trigonometric Functions.
1122                                                              (line  24)
1123* mpc_asinh:                             Trigonometric Functions.
1124                                                              (line  30)
1125* mpc_atan:                              Trigonometric Functions.
1126                                                              (line  26)
1127* mpc_atanh:                             Trigonometric Functions.
1128                                                              (line  32)
1129* mpc_clear:                             Initializing Complex Numbers.
1130                                                              (line  21)
1131* mpc_cmp:                               Complex Comparison.  (line   6)
1132* mpc_cmp_abs:                           Complex Comparison.  (line  23)
1133* mpc_cmp_si:                            Complex Comparison.  (line   9)
1134* mpc_cmp_si_si:                         Complex Comparison.  (line   7)
1135* mpc_conj:                              Basic Arithmetic.    (line  86)
1136* mpc_cos:                               Trigonometric Functions.
1137                                                              (line   7)
1138* mpc_cosh:                              Trigonometric Functions.
1139                                                              (line  19)
1140* mpc_div:                               Basic Arithmetic.    (line  74)
1141* mpc_div_2si:                           Basic Arithmetic.    (line 109)
1142* mpc_div_2ui:                           Basic Arithmetic.    (line 107)
1143* mpc_div_fr:                            Basic Arithmetic.    (line  78)
1144* mpc_div_ui:                            Basic Arithmetic.    (line  76)
1145* mpc_dot:                               Basic Arithmetic.    (line  69)
1146* mpc_exp:                               Power Functions and Logarithm.
1147                                                              (line  32)
1148* mpc_fma:                               Basic Arithmetic.    (line  64)
1149* mpc_free_str:                          String and Stream Input and Output.
1150                                                              (line  66)
1151* mpc_fr_div:                            Basic Arithmetic.    (line  82)
1152* mpc_fr_sub:                            Basic Arithmetic.    (line  23)
1153* mpc_get_ldc:                           Converting Complex Numbers.
1154                                                              (line  10)
1155* mpc_get_prec:                          Initializing Complex Numbers.
1156                                                              (line  49)
1157* mpc_get_prec2:                         Initializing Complex Numbers.
1158                                                              (line  53)
1159* mpc_get_str:                           String and Stream Input and Output.
1160                                                              (line  48)
1161* mpc_get_version:                       Miscellaneous Complex Functions.
1162                                                              (line  14)
1163* mpc_imag:                              Projection & Decomposing.
1164                                                              (line  10)
1165* mpc_imagref:                           Projection & Decomposing.
1166                                                              (line  15)
1167* mpc_init2:                             Initializing Complex Numbers.
1168                                                              (line  10)
1169* mpc_init3:                             Initializing Complex Numbers.
1170                                                              (line  15)
1171* mpc_inp_str:                           String and Stream Input and Output.
1172                                                              (line  74)
1173* mpc_log:                               Power Functions and Logarithm.
1174                                                              (line  36)
1175* mpc_log10:                             Power Functions and Logarithm.
1176                                                              (line  37)
1177* mpc_mul:                               Basic Arithmetic.    (line  43)
1178* mpc_mul_2si:                           Basic Arithmetic.    (line 101)
1179* mpc_mul_2ui:                           Basic Arithmetic.    (line  99)
1180* mpc_mul_fr:                            Basic Arithmetic.    (line  49)
1181* mpc_mul_i:                             Basic Arithmetic.    (line  55)
1182* mpc_mul_si:                            Basic Arithmetic.    (line  47)
1183* mpc_mul_ui:                            Basic Arithmetic.    (line  45)
1184* mpc_neg:                               Basic Arithmetic.    (line  34)
1185* mpc_norm:                              Basic Arithmetic.    (line  95)
1186* mpc_out_str:                           String and Stream Input and Output.
1187                                                              (line 109)
1188* mpc_pow:                               Power Functions and Logarithm.
1189                                                              (line  11)
1190* mpc_pow_d:                             Power Functions and Logarithm.
1191                                                              (line  13)
1192* mpc_pow_fr:                            Power Functions and Logarithm.
1193                                                              (line  23)
1194* mpc_pow_ld:                            Power Functions and Logarithm.
1195                                                              (line  15)
1196* mpc_pow_si:                            Power Functions and Logarithm.
1197                                                              (line  17)
1198* mpc_pow_ui:                            Power Functions and Logarithm.
1199                                                              (line  19)
1200* mpc_pow_z:                             Power Functions and Logarithm.
1201                                                              (line  21)
1202* mpc_proj:                              Projection & Decomposing.
1203                                                              (line  24)
1204* mpc_real:                              Projection & Decomposing.
1205                                                              (line   6)
1206* mpc_realref:                           Projection & Decomposing.
1207                                                              (line  14)
1208* mpc_rnd_t:                             GNU MPC Basics.      (line  24)
1209* mpc_rootofunity:                       Power Functions and Logarithm.
1210                                                              (line  44)
1211* mpc_set:                               Assigning Complex Numbers.
1212                                                              (line  16)
1213* mpc_set_d:                             Assigning Complex Numbers.
1214                                                              (line  25)
1215* mpc_set_dc:                            Assigning Complex Numbers.
1216                                                              (line  27)
1217* mpc_set_d_d:                           Assigning Complex Numbers.
1218                                                              (line  54)
1219* mpc_set_f:                             Assigning Complex Numbers.
1220                                                              (line  33)
1221* mpc_set_fr:                            Assigning Complex Numbers.
1222                                                              (line  34)
1223* mpc_set_fr_fr:                         Assigning Complex Numbers.
1224                                                              (line  64)
1225* mpc_set_f_f:                           Assigning Complex Numbers.
1226                                                              (line  62)
1227* mpc_set_ld:                            Assigning Complex Numbers.
1228                                                              (line  26)
1229* mpc_set_ldc:                           Assigning Complex Numbers.
1230                                                              (line  29)
1231* mpc_set_ld_ld:                         Assigning Complex Numbers.
1232                                                              (line  56)
1233* mpc_set_nan:                           Assigning Complex Numbers.
1234                                                              (line  79)
1235* mpc_set_prec:                          Initializing Complex Numbers.
1236                                                              (line  41)
1237* mpc_set_q:                             Assigning Complex Numbers.
1238                                                              (line  32)
1239* mpc_set_q_q:                           Assigning Complex Numbers.
1240                                                              (line  60)
1241* mpc_set_si:                            Assigning Complex Numbers.
1242                                                              (line  22)
1243* mpc_set_si_si:                         Assigning Complex Numbers.
1244                                                              (line  48)
1245* mpc_set_sj:                            Assigning Complex Numbers.
1246                                                              (line  24)
1247* mpc_set_sj_sj:                         Assigning Complex Numbers.
1248                                                              (line  52)
1249* mpc_set_str:                           String and Stream Input and Output.
1250                                                              (line  35)
1251* mpc_set_ui:                            Assigning Complex Numbers.
1252                                                              (line  20)
1253* mpc_set_ui_ui:                         Assigning Complex Numbers.
1254                                                              (line  46)
1255* mpc_set_uj:                            Assigning Complex Numbers.
1256                                                              (line  23)
1257* mpc_set_uj_uj:                         Assigning Complex Numbers.
1258                                                              (line  50)
1259* MPC_SET_X_Y:                           Advanced Functions.  (line   6)
1260* mpc_set_z:                             Assigning Complex Numbers.
1261                                                              (line  31)
1262* mpc_set_z_z:                           Assigning Complex Numbers.
1263                                                              (line  58)
1264* mpc_sin:                               Trigonometric Functions.
1265                                                              (line   6)
1266* mpc_sinh:                              Trigonometric Functions.
1267                                                              (line  18)
1268* mpc_sin_cos:                           Trigonometric Functions.
1269                                                              (line  12)
1270* mpc_sqr:                               Basic Arithmetic.    (line  61)
1271* mpc_sqrt:                              Power Functions and Logarithm.
1272                                                              (line   6)
1273* mpc_strtoc:                            String and Stream Input and Output.
1274                                                              (line   6)
1275* mpc_sub:                               Basic Arithmetic.    (line  19)
1276* mpc_sub_fr:                            Basic Arithmetic.    (line  21)
1277* mpc_sub_ui:                            Basic Arithmetic.    (line  25)
1278* mpc_sum:                               Basic Arithmetic.    (line  38)
1279* mpc_swap:                              Assigning Complex Numbers.
1280                                                              (line  82)
1281* mpc_t:                                 GNU MPC Basics.      (line  15)
1282* mpc_tan:                               Trigonometric Functions.
1283                                                              (line   8)
1284* mpc_tanh:                              Trigonometric Functions.
1285                                                              (line  20)
1286* mpc_ui_div:                            Basic Arithmetic.    (line  80)
1287* mpc_ui_sub:                            Basic Arithmetic.    (line  27)
1288* mpc_ui_ui_sub:                         Basic Arithmetic.    (line  29)
1289* mpc_urandom:                           Miscellaneous Complex Functions.
1290                                                              (line   6)
1291* MPC_VERSION:                           Miscellaneous Complex Functions.
1292                                                              (line  17)
1293* MPC_VERSION_MAJOR:                     Miscellaneous Complex Functions.
1294                                                              (line  18)
1295* MPC_VERSION_MINOR:                     Miscellaneous Complex Functions.
1296                                                              (line  19)
1297* MPC_VERSION_NUM:                       Miscellaneous Complex Functions.
1298                                                              (line  36)
1299* MPC_VERSION_PATCHLEVEL:                Miscellaneous Complex Functions.
1300                                                              (line  20)
1301* MPC_VERSION_STRING:                    Miscellaneous Complex Functions.
1302                                                              (line  21)
1303* mpfr_prec_t:                           GNU MPC Basics.      (line  19)
1304
1305
1306File: mpc.info,  Node: GNU Free Documentation License,  Prev: Function Index,  Up: Top
1307
1308Appendix A GNU Free Documentation License
1309*****************************************
1310
1311                     Version 1.3, 3 November 2008
1312
1313     Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
1314     <http://fsf.org/>
1315
1316     Everyone is permitted to copy and distribute verbatim copies
1317     of this license document, but changing it is not allowed.
1318
1319  0. PREAMBLE
1320
1321     The purpose of this License is to make a manual, textbook, or other
1322     functional and useful document "free" in the sense of freedom: to
1323     assure everyone the effective freedom to copy and redistribute it,
1324     with or without modifying it, either commercially or
1325     noncommercially.  Secondarily, this License preserves for the
1326     author and publisher a way to get credit for their work, while not
1327     being considered responsible for modifications made by others.
1328
1329     This License is a kind of "copyleft", which means that derivative
1330     works of the document must themselves be free in the same sense.
1331     It complements the GNU General Public License, which is a copyleft
1332     license designed for free software.
1333
1334     We have designed this License in order to use it for manuals for
1335     free software, because free software needs free documentation: a
1336     free program should come with manuals providing the same freedoms
1337     that the software does.  But this License is not limited to
1338     software manuals; it can be used for any textual work, regardless
1339     of subject matter or whether it is published as a printed book.  We
1340     recommend this License principally for works whose purpose is
1341     instruction or reference.
1342
1343  1. APPLICABILITY AND DEFINITIONS
1344
1345     This License applies to any manual or other work, in any medium,
1346     that contains a notice placed by the copyright holder saying it can
1347     be distributed under the terms of this License.  Such a notice
1348     grants a world-wide, royalty-free license, unlimited in duration,
1349     to use that work under the conditions stated herein.  The
1350     "Document", below, refers to any such manual or work.  Any member
1351     of the public is a licensee, and is addressed as "you".  You accept
1352     the license if you copy, modify or distribute the work in a way
1353     requiring permission under copyright law.
1354
1355     A "Modified Version" of the Document means any work containing the
1356     Document or a portion of it, either copied verbatim, or with
1357     modifications and/or translated into another language.
1358
1359     A "Secondary Section" is a named appendix or a front-matter section
1360     of the Document that deals exclusively with the relationship of the
1361     publishers or authors of the Document to the Document's overall
1362     subject (or to related matters) and contains nothing that could
1363     fall directly within that overall subject.  (Thus, if the Document
1364     is in part a textbook of mathematics, a Secondary Section may not
1365     explain any mathematics.)  The relationship could be a matter of
1366     historical connection with the subject or with related matters, or
1367     of legal, commercial, philosophical, ethical or political position
1368     regarding them.
1369
1370     The "Invariant Sections" are certain Secondary Sections whose
1371     titles are designated, as being those of Invariant Sections, in the
1372     notice that says that the Document is released under this License.
1373     If a section does not fit the above definition of Secondary then it
1374     is not allowed to be designated as Invariant.  The Document may
1375     contain zero Invariant Sections.  If the Document does not identify
1376     any Invariant Sections then there are none.
1377
1378     The "Cover Texts" are certain short passages of text that are
1379     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
1380     that says that the Document is released under this License.  A
1381     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
1382     be at most 25 words.
1383
1384     A "Transparent" copy of the Document means a machine-readable copy,
1385     represented in a format whose specification is available to the
1386     general public, that is suitable for revising the document
1387     straightforwardly with generic text editors or (for images composed
1388     of pixels) generic paint programs or (for drawings) some widely
1389     available drawing editor, and that is suitable for input to text
1390     formatters or for automatic translation to a variety of formats
1391     suitable for input to text formatters.  A copy made in an otherwise
1392     Transparent file format whose markup, or absence of markup, has
1393     been arranged to thwart or discourage subsequent modification by
1394     readers is not Transparent.  An image format is not Transparent if
1395     used for any substantial amount of text.  A copy that is not
1396     "Transparent" is called "Opaque".
1397
1398     Examples of suitable formats for Transparent copies include plain
1399     ASCII without markup, Texinfo input format, LaTeX input format,
1400     SGML or XML using a publicly available DTD, and standard-conforming
1401     simple HTML, PostScript or PDF designed for human modification.
1402     Examples of transparent image formats include PNG, XCF and JPG.
1403     Opaque formats include proprietary formats that can be read and
1404     edited only by proprietary word processors, SGML or XML for which
1405     the DTD and/or processing tools are not generally available, and
1406     the machine-generated HTML, PostScript or PDF produced by some word
1407     processors for output purposes only.
1408
1409     The "Title Page" means, for a printed book, the title page itself,
1410     plus such following pages as are needed to hold, legibly, the
1411     material this License requires to appear in the title page.  For
1412     works in formats which do not have any title page as such, "Title
1413     Page" means the text near the most prominent appearance of the
1414     work's title, preceding the beginning of the body of the text.
1415
1416     The "publisher" means any person or entity that distributes copies
1417     of the Document to the public.
1418
1419     A section "Entitled XYZ" means a named subunit of the Document
1420     whose title either is precisely XYZ or contains XYZ in parentheses
1421     following text that translates XYZ in another language.  (Here XYZ
1422     stands for a specific section name mentioned below, such as
1423     "Acknowledgements", "Dedications", "Endorsements", or "History".)
1424     To "Preserve the Title" of such a section when you modify the
1425     Document means that it remains a section "Entitled XYZ" according
1426     to this definition.
1427
1428     The Document may include Warranty Disclaimers next to the notice
1429     which states that this License applies to the Document.  These
1430     Warranty Disclaimers are considered to be included by reference in
1431     this License, but only as regards disclaiming warranties: any other
1432     implication that these Warranty Disclaimers may have is void and
1433     has no effect on the meaning of this License.
1434
1435  2. VERBATIM COPYING
1436
1437     You may copy and distribute the Document in any medium, either
1438     commercially or noncommercially, provided that this License, the
1439     copyright notices, and the license notice saying this License
1440     applies to the Document are reproduced in all copies, and that you
1441     add no other conditions whatsoever to those of this License.  You
1442     may not use technical measures to obstruct or control the reading
1443     or further copying of the copies you make or distribute.  However,
1444     you may accept compensation in exchange for copies.  If you
1445     distribute a large enough number of copies you must also follow the
1446     conditions in section 3.
1447
1448     You may also lend copies, under the same conditions stated above,
1449     and you may publicly display copies.
1450
1451  3. COPYING IN QUANTITY
1452
1453     If you publish printed copies (or copies in media that commonly
1454     have printed covers) of the Document, numbering more than 100, and
1455     the Document's license notice requires Cover Texts, you must
1456     enclose the copies in covers that carry, clearly and legibly, all
1457     these Cover Texts: Front-Cover Texts on the front cover, and
1458     Back-Cover Texts on the back cover.  Both covers must also clearly
1459     and legibly identify you as the publisher of these copies.  The
1460     front cover must present the full title with all words of the title
1461     equally prominent and visible.  You may add other material on the
1462     covers in addition.  Copying with changes limited to the covers, as
1463     long as they preserve the title of the Document and satisfy these
1464     conditions, can be treated as verbatim copying in other respects.
1465
1466     If the required texts for either cover are too voluminous to fit
1467     legibly, you should put the first ones listed (as many as fit
1468     reasonably) on the actual cover, and continue the rest onto
1469     adjacent pages.
1470
1471     If you publish or distribute Opaque copies of the Document
1472     numbering more than 100, you must either include a machine-readable
1473     Transparent copy along with each Opaque copy, or state in or with
1474     each Opaque copy a computer-network location from which the general
1475     network-using public has access to download using public-standard
1476     network protocols a complete Transparent copy of the Document, free
1477     of added material.  If you use the latter option, you must take
1478     reasonably prudent steps, when you begin distribution of Opaque
1479     copies in quantity, to ensure that this Transparent copy will
1480     remain thus accessible at the stated location until at least one
1481     year after the last time you distribute an Opaque copy (directly or
1482     through your agents or retailers) of that edition to the public.
1483
1484     It is requested, but not required, that you contact the authors of
1485     the Document well before redistributing any large number of copies,
1486     to give them a chance to provide you with an updated version of the
1487     Document.
1488
1489  4. MODIFICATIONS
1490
1491     You may copy and distribute a Modified Version of the Document
1492     under the conditions of sections 2 and 3 above, provided that you
1493     release the Modified Version under precisely this License, with the
1494     Modified Version filling the role of the Document, thus licensing
1495     distribution and modification of the Modified Version to whoever
1496     possesses a copy of it.  In addition, you must do these things in
1497     the Modified Version:
1498
1499       A. Use in the Title Page (and on the covers, if any) a title
1500          distinct from that of the Document, and from those of previous
1501          versions (which should, if there were any, be listed in the
1502          History section of the Document).  You may use the same title
1503          as a previous version if the original publisher of that
1504          version gives permission.
1505
1506       B. List on the Title Page, as authors, one or more persons or
1507          entities responsible for authorship of the modifications in
1508          the Modified Version, together with at least five of the
1509          principal authors of the Document (all of its principal
1510          authors, if it has fewer than five), unless they release you
1511          from this requirement.
1512
1513       C. State on the Title page the name of the publisher of the
1514          Modified Version, as the publisher.
1515
1516       D. Preserve all the copyright notices of the Document.
1517
1518       E. Add an appropriate copyright notice for your modifications
1519          adjacent to the other copyright notices.
1520
1521       F. Include, immediately after the copyright notices, a license
1522          notice giving the public permission to use the Modified
1523          Version under the terms of this License, in the form shown in
1524          the Addendum below.
1525
1526       G. Preserve in that license notice the full lists of Invariant
1527          Sections and required Cover Texts given in the Document's
1528          license notice.
1529
1530       H. Include an unaltered copy of this License.
1531
1532       I. Preserve the section Entitled "History", Preserve its Title,
1533          and add to it an item stating at least the title, year, new
1534          authors, and publisher of the Modified Version as given on the
1535          Title Page.  If there is no section Entitled "History" in the
1536          Document, create one stating the title, year, authors, and
1537          publisher of the Document as given on its Title Page, then add
1538          an item describing the Modified Version as stated in the
1539          previous sentence.
1540
1541       J. Preserve the network location, if any, given in the Document
1542          for public access to a Transparent copy of the Document, and
1543          likewise the network locations given in the Document for
1544          previous versions it was based on.  These may be placed in the
1545          "History" section.  You may omit a network location for a work
1546          that was published at least four years before the Document
1547          itself, or if the original publisher of the version it refers
1548          to gives permission.
1549
1550       K. For any section Entitled "Acknowledgements" or "Dedications",
1551          Preserve the Title of the section, and preserve in the section
1552          all the substance and tone of each of the contributor
1553          acknowledgements and/or dedications given therein.
1554
1555       L. Preserve all the Invariant Sections of the Document, unaltered
1556          in their text and in their titles.  Section numbers or the
1557          equivalent are not considered part of the section titles.
1558
1559       M. Delete any section Entitled "Endorsements".  Such a section
1560          may not be included in the Modified Version.
1561
1562       N. Do not retitle any existing section to be Entitled
1563          "Endorsements" or to conflict in title with any Invariant
1564          Section.
1565
1566       O. Preserve any Warranty Disclaimers.
1567
1568     If the Modified Version includes new front-matter sections or
1569     appendices that qualify as Secondary Sections and contain no
1570     material copied from the Document, you may at your option designate
1571     some or all of these sections as invariant.  To do this, add their
1572     titles to the list of Invariant Sections in the Modified Version's
1573     license notice.  These titles must be distinct from any other
1574     section titles.
1575
1576     You may add a section Entitled "Endorsements", provided it contains
1577     nothing but endorsements of your Modified Version by various
1578     parties--for example, statements of peer review or that the text
1579     has been approved by an organization as the authoritative
1580     definition of a standard.
1581
1582     You may add a passage of up to five words as a Front-Cover Text,
1583     and a passage of up to 25 words as a Back-Cover Text, to the end of
1584     the list of Cover Texts in the Modified Version.  Only one passage
1585     of Front-Cover Text and one of Back-Cover Text may be added by (or
1586     through arrangements made by) any one entity.  If the Document
1587     already includes a cover text for the same cover, previously added
1588     by you or by arrangement made by the same entity you are acting on
1589     behalf of, you may not add another; but you may replace the old
1590     one, on explicit permission from the previous publisher that added
1591     the old one.
1592
1593     The author(s) and publisher(s) of the Document do not by this
1594     License give permission to use their names for publicity for or to
1595     assert or imply endorsement of any Modified Version.
1596
1597  5. COMBINING DOCUMENTS
1598
1599     You may combine the Document with other documents released under
1600     this License, under the terms defined in section 4 above for
1601     modified versions, provided that you include in the combination all
1602     of the Invariant Sections of all of the original documents,
1603     unmodified, and list them all as Invariant Sections of your
1604     combined work in its license notice, and that you preserve all
1605     their Warranty Disclaimers.
1606
1607     The combined work need only contain one copy of this License, and
1608     multiple identical Invariant Sections may be replaced with a single
1609     copy.  If there are multiple Invariant Sections with the same name
1610     but different contents, make the title of each such section unique
1611     by adding at the end of it, in parentheses, the name of the
1612     original author or publisher of that section if known, or else a
1613     unique number.  Make the same adjustment to the section titles in
1614     the list of Invariant Sections in the license notice of the
1615     combined work.
1616
1617     In the combination, you must combine any sections Entitled
1618     "History" in the various original documents, forming one section
1619     Entitled "History"; likewise combine any sections Entitled
1620     "Acknowledgements", and any sections Entitled "Dedications".  You
1621     must delete all sections Entitled "Endorsements."
1622
1623  6. COLLECTIONS OF DOCUMENTS
1624
1625     You may make a collection consisting of the Document and other
1626     documents released under this License, and replace the individual
1627     copies of this License in the various documents with a single copy
1628     that is included in the collection, provided that you follow the
1629     rules of this License for verbatim copying of each of the documents
1630     in all other respects.
1631
1632     You may extract a single document from such a collection, and
1633     distribute it individually under this License, provided you insert
1634     a copy of this License into the extracted document, and follow this
1635     License in all other respects regarding verbatim copying of that
1636     document.
1637
1638  7. AGGREGATION WITH INDEPENDENT WORKS
1639
1640     A compilation of the Document or its derivatives with other
1641     separate and independent documents or works, in or on a volume of a
1642     storage or distribution medium, is called an "aggregate" if the
1643     copyright resulting from the compilation is not used to limit the
1644     legal rights of the compilation's users beyond what the individual
1645     works permit.  When the Document is included in an aggregate, this
1646     License does not apply to the other works in the aggregate which
1647     are not themselves derivative works of the Document.
1648
1649     If the Cover Text requirement of section 3 is applicable to these
1650     copies of the Document, then if the Document is less than one half
1651     of the entire aggregate, the Document's Cover Texts may be placed
1652     on covers that bracket the Document within the aggregate, or the
1653     electronic equivalent of covers if the Document is in electronic
1654     form.  Otherwise they must appear on printed covers that bracket
1655     the whole aggregate.
1656
1657  8. TRANSLATION
1658
1659     Translation is considered a kind of modification, so you may
1660     distribute translations of the Document under the terms of section
1661     4.  Replacing Invariant Sections with translations requires special
1662     permission from their copyright holders, but you may include
1663     translations of some or all Invariant Sections in addition to the
1664     original versions of these Invariant Sections.  You may include a
1665     translation of this License, and all the license notices in the
1666     Document, and any Warranty Disclaimers, provided that you also
1667     include the original English version of this License and the
1668     original versions of those notices and disclaimers.  In case of a
1669     disagreement between the translation and the original version of
1670     this License or a notice or disclaimer, the original version will
1671     prevail.
1672
1673     If a section in the Document is Entitled "Acknowledgements",
1674     "Dedications", or "History", the requirement (section 4) to
1675     Preserve its Title (section 1) will typically require changing the
1676     actual title.
1677
1678  9. TERMINATION
1679
1680     You may not copy, modify, sublicense, or distribute the Document
1681     except as expressly provided under this License.  Any attempt
1682     otherwise to copy, modify, sublicense, or distribute it is void,
1683     and will automatically terminate your rights under this License.
1684
1685     However, if you cease all violation of this License, then your
1686     license from a particular copyright holder is reinstated (a)
1687     provisionally, unless and until the copyright holder explicitly and
1688     finally terminates your license, and (b) permanently, if the
1689     copyright holder fails to notify you of the violation by some
1690     reasonable means prior to 60 days after the cessation.
1691
1692     Moreover, your license from a particular copyright holder is
1693     reinstated permanently if the copyright holder notifies you of the
1694     violation by some reasonable means, this is the first time you have
1695     received notice of violation of this License (for any work) from
1696     that copyright holder, and you cure the violation prior to 30 days
1697     after your receipt of the notice.
1698
1699     Termination of your rights under this section does not terminate
1700     the licenses of parties who have received copies or rights from you
1701     under this License.  If your rights have been terminated and not
1702     permanently reinstated, receipt of a copy of some or all of the
1703     same material does not give you any rights to use it.
1704
1705  10. FUTURE REVISIONS OF THIS LICENSE
1706
1707     The Free Software Foundation may publish new, revised versions of
1708     the GNU Free Documentation License from time to time.  Such new
1709     versions will be similar in spirit to the present version, but may
1710     differ in detail to address new problems or concerns.  See
1711     <http://www.gnu.org/copyleft/>.
1712
1713     Each version of the License is given a distinguishing version
1714     number.  If the Document specifies that a particular numbered
1715     version of this License "or any later version" applies to it, you
1716     have the option of following the terms and conditions either of
1717     that specified version or of any later version that has been
1718     published (not as a draft) by the Free Software Foundation.  If the
1719     Document does not specify a version number of this License, you may
1720     choose any version ever published (not as a draft) by the Free
1721     Software Foundation.  If the Document specifies that a proxy can
1722     decide which future versions of this License can be used, that
1723     proxy's public statement of acceptance of a version permanently
1724     authorizes you to choose that version for the Document.
1725
1726  11. RELICENSING
1727
1728     "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
1729     World Wide Web server that publishes copyrightable works and also
1730     provides prominent facilities for anybody to edit those works.  A
1731     public wiki that anybody can edit is an example of such a server.
1732     A "Massive Multiauthor Collaboration" (or "MMC") contained in the
1733     site means any set of copyrightable works thus published on the MMC
1734     site.
1735
1736     "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
1737     license published by Creative Commons Corporation, a not-for-profit
1738     corporation with a principal place of business in San Francisco,
1739     California, as well as future copyleft versions of that license
1740     published by that same organization.
1741
1742     "Incorporate" means to publish or republish a Document, in whole or
1743     in part, as part of another Document.
1744
1745     An MMC is "eligible for relicensing" if it is licensed under this
1746     License, and if all works that were first published under this
1747     License somewhere other than this MMC, and subsequently
1748     incorporated in whole or in part into the MMC, (1) had no cover
1749     texts or invariant sections, and (2) were thus incorporated prior
1750     to November 1, 2008.
1751
1752     The operator of an MMC Site may republish an MMC contained in the
1753     site under CC-BY-SA on the same site at any time before August 1,
1754     2009, provided the MMC is eligible for relicensing.
1755
1756ADDENDUM: How to use this License for your documents
1757====================================================
1758
1759To use this License in a document you have written, include a copy of
1760the License in the document and put the following copyright and license
1761notices just after the title page:
1762
1763       Copyright (C)  YEAR  YOUR NAME.
1764       Permission is granted to copy, distribute and/or modify this document
1765       under the terms of the GNU Free Documentation License, Version 1.3
1766       or any later version published by the Free Software Foundation;
1767       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
1768       Texts.  A copy of the license is included in the section entitled ``GNU
1769       Free Documentation License''.
1770
1771   If you have Invariant Sections, Front-Cover Texts and Back-Cover
1772Texts, replace the "with...Texts."  line with this:
1773
1774         with the Invariant Sections being LIST THEIR TITLES, with
1775         the Front-Cover Texts being LIST, and with the Back-Cover Texts
1776         being LIST.
1777
1778   If you have Invariant Sections without Cover Texts, or some other
1779combination of the three, merge those two alternatives to suit the
1780situation.
1781
1782   If your document contains nontrivial examples of program code, we
1783recommend releasing these examples in parallel under your choice of free
1784software license, such as the GNU General Public License, to permit
1785their use in free software.
1786
1787
1788
1789Tag Table:
1790Node: Top759
1791Node: Copying1466
1792Node: Introduction to GNU MPC2238
1793Node: Installing GNU MPC2957
1794Node: Reporting Bugs8042
1795Node: GNU MPC Basics9386
1796Ref: return-value13063
1797Node: Complex Functions14514
1798Node: Initializing Complex Numbers15674
1799Node: Assigning Complex Numbers18073
1800Node: Converting Complex Numbers22551
1801Node: String and Stream Input and Output23182
1802Node: Complex Comparison29750
1803Node: Projection & Decomposing31293
1804Node: Basic Arithmetic32694
1805Node: Power Functions and Logarithm37946
1806Node: Trigonometric Functions40379
1807Node: Miscellaneous Complex Functions42344
1808Node: Advanced Functions44520
1809Node: Internals45602
1810Node: References46053
1811Node: Concept Index46830
1812Node: Function Index49144
1813Node: GNU Free Documentation License63292
1814
1815End Tag Table
1816
1817
1818Local Variables:
1819coding: utf-8
1820End:
1821