1 This is mpc.info, produced by makeinfo version 4.13 from mpc.texi.
4 * mpc: (mpc.info). Multiple Precision Complex Library.
7 This is the manual for MPC, a library for multiple precision complex
8 arithmetic, version 0.9, of February 2011.
11 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
16 Permission is granted to make and distribute verbatim copies of this
17 manual provided the copyright notice and this permission notice are
18 preserved on all copies.
20 Permission is granted to copy and distribute modified versions of
21 this manual under the conditions for verbatim copying, provided that
22 the entire resulting derived work is distributed under the terms of a
23 permission notice identical to this one.
25 Permission is granted to copy and distribute translations of this
26 manual into another language, under the above conditions for modified
30 File: mpc.info, Node: Top, Next: Copying, Prev: (dir), Up: (dir)
35 This manual documents how to install and use the Multiple Precision
36 Complex Library, version 0.9
40 * Copying:: MPC Copying Conditions (LGPL).
41 * Introduction to MPC:: Brief introduction to MPC.
42 * Installing MPC:: How to configure and compile the MPC library.
43 * Reporting Bugs:: How to usefully report bugs.
44 * MPC Basics:: What every MPC user should know.
45 * Complex Functions:: Functions for arithmetic on complex numbers.
52 File: mpc.info, Node: Copying, Next: Introduction to MPC, Prev: Top, Up: Top
54 MPC Copying Conditions
55 **********************
57 The MPC Library is free software; you can redistribute it and/or modify
58 it under the terms of the GNU Lesser General Public License as
59 published by the Free Software Foundation; either version 2.1 of the
60 License, or (at your option) any later version, see the file
63 The MPC Library is distributed in the hope that it will be useful,
64 but WITHOUT ANY WARRANTY; without even the implied warranty of
65 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
66 Lesser General Public License for more details.
69 File: mpc.info, Node: Introduction to MPC, Next: Installing MPC, Prev: Copying, Up: Top
74 MPC is a portable library written in C for arbitrary precision
75 arithmetic on complex numbers providing correct rounding. Ultimately, it
76 should implement a multiprecision equivalent of the C99 standard. It
77 builds upon the GNU MP and the GNU MPFR libraries.
79 1.1 How to use this Manual
80 ==========================
82 Everyone should read *note MPC Basics::. If you need to install the
83 library yourself, you need to read *note Installing MPC::, too.
85 The remainder of the manual can be used for later reference,
86 although it is probably a good idea to skim through it.
89 File: mpc.info, Node: Installing MPC, Next: Reporting Bugs, Prev: Introduction to MPC, Up: Top
94 To build MPC, you first have to install GNU MP (version 4.3.2 or
95 higher) and GNU MPFR (version 2.4.2 or higher) on your computer. You
96 need a C compiler, preferably GCC, but any reasonable compiler should
97 work. And you need a standard Unix `make' program, plus some other
98 standard Unix utility programs.
100 Here are the steps needed to install the library on Unix systems:
102 1. `tar xzf mpc-0.9.tar.gz'
108 if GMP and MPFR are installed into standard directories, that is,
109 directories that are searched by default by the compiler and the
112 `./configure --with-gmp=<gmp_install_dir>'
114 is used to indicate a different location where GMP is installed.
115 Alternatively, you can specify directly GMP include and GMP lib
116 directories with `./configure --with-gmp-lib=<gmp_lib_dir>
117 --with-gmp-include=<gmp_include_dir>'.
119 `./configure --with-mpfr=<mpfr_install_dir>'
121 is used to indicate a different location where MPFR is installed.
122 Alternatively, you can specify directly MPFR include and MPFR lib
123 directories with `./configure --with-mpf-lib=<mpfr_lib_dir>
124 --with-mpfr-include=<mpfr_include_dir>'.
126 Another useful parameter is `--prefix', which can be used to
127 specify an alternative installation location instead of
128 `/usr/local'; see `make install' below.
130 If for debugging purposes you wish to log calls to MPC functions
131 from within your code, add the parameter `--enable-logging'. In
132 your code, replace the inclusion of `mpc.h' by `mpc-log.h' and
133 link the executable dynamically. Then all calls to functions with
134 only complex arguments are printed to `stderr' in the following
135 form: First, the function name is given, followed by its type such
136 as `c_cc', meaning that the function has one complex result (one
137 `c' in front of the `_'), computed from two complex arguments (two
138 `c' after the `_'). Then, the precisions of the real and the
139 imaginary part of the first result is given, followed by the
140 second one and so on. Finally, for each argument, the precisions
141 of its real and imaginary part are specified and the argument
142 itself is printed in hexadecimal via the function `mpc_out_str'
143 (*note String and Stream Input and Output: string-io.).
145 Use `./configure --help' for an exhaustive list of parameters.
149 This compiles MPC in the working directory.
153 This will make sure MPC was built correctly.
155 If you get error messages, please report them to
156 `mpc-discuss@lists.gforge.inria.fr' (*Note Reporting Bugs::, for
157 information on what to include in useful bug reports).
161 This will copy the file `mpc.h' to the directory
162 `/usr/local/include', the file `libmpc.a' to the directory
163 `/usr/local/lib', and the file `mpc.info' to the directory
164 `/usr/local/share/info' (or if you passed the `--prefix' option to
165 `configure', using the prefix directory given as argument to
166 `--prefix' instead of `/usr/local'). Note: you need write
167 permissions on these directories.
170 2.1 Other `make' Targets
171 ========================
173 There are some other useful make targets:
177 Create an info version of the manual, in `mpc.info'.
181 Create a PDF version of the manual, in `doc/mpc.pdf'.
185 Create a DVI version of the manual, in `doc/mpc.dvi'.
189 Create a Postscript version of the manual, in `doc/mpc.ps'.
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.
199 Delete all object files and archive files, but not the
204 Delete all files not included in the distribution.
208 Delete all files copied by `make install'.
210 2.2 Known Build Problems
211 ========================
213 On AIX, if GMP was built with the 64-bit ABI, before building and
214 testing MPC, it might be necessary to set the `OBJECT_MODE' environment
215 variable to 64 by, e.g.,
217 `export OBJECT_MODE=64'
219 This has been tested with the C compiler IBM XL C/C++ Enterprise
220 Edition V8.0 for AIX, version: 08.00.0000.0021, GMP 4.2.4 and MPFR
223 Please report any other problems you encounter to
224 `mpc-discuss@lists.gforge.inria.fr'. *Note Reporting Bugs::.
227 File: mpc.info, Node: Reporting Bugs, Next: MPC Basics, Prev: Installing MPC, Up: Top
232 If you think you have found a bug in the MPC library, please investigate
233 and report it. We have made this library available to you, and it is
234 not to ask too much from you, to ask you to report the bugs that you
237 There are a few things you should think about when you put your bug
240 You have to send us a test case that makes it possible for us to
241 reproduce the bug. Include instructions on how to run the test case.
243 You also have to explain what is wrong; if you get a crash, or if
244 the results printed are incorrect and in that case, in what way.
246 Please include compiler version information in your bug report.
247 This can be extracted using `gcc -v', or `cc -V' on some machines.
248 Also, include the output from `uname -a'.
250 If your bug report is good, we will do our best to help you to get a
251 corrected version of the library; if the bug report is poor, we will
252 not do anything about it (aside of chiding you to send better bug
255 Send your bug report to: `mpc-discuss@lists.gforge.inria.fr'.
257 If you think something in this manual is unclear, or downright
258 incorrect, or if the language needs to be improved, please send a note
262 File: mpc.info, Node: MPC Basics, Next: Complex Functions, Prev: Reporting Bugs, Up: Top
267 All declarations needed to use MPC are collected in the include file
268 `mpc.h'. It is designed to work with both C and C++ compilers. You
269 should include that file in any program using the MPC library by adding
273 4.1 Nomenclature and Types
274 ==========================
276 "Complex number" or "Complex" for short, is a pair of two arbitrary
277 precision floating-point numbers (for the real and imaginary parts).
278 The C data type for such objects is `mpc_t'.
280 The "Precision" is the number of bits used to represent the mantissa of
281 the real and imaginary parts; the corresponding C data type is
282 `mpfr_prec_t'. For more details on the allowed precision range, *note
283 Nomenclature and Types: (mpfr.info)Nomenclature and Types.
285 The "rounding mode" specifies the way to round the result of a complex
286 operation, in case the exact result can not be represented exactly in
287 the destination mantissa; the corresponding C data type is `mpc_rnd_t'.
288 A complex rounding mode is a pair of two rounding modes: one for the
289 real part, one for the imaginary part.
294 There is only one class of functions in the MPC library, namely
295 functions for complex arithmetic. The function names begin with `mpc_'.
296 The associated type is `mpc_t'.
298 4.3 MPC Variable Conventions
299 ============================
301 As a general rule, all MPC functions expect output arguments before
302 input arguments. This notation is based on an analogy with the
305 MPC allows you to use the same variable for both input and output in
306 the same expression. For example, the main function for floating-point
307 multiplication, `mpc_mul', can be used like this: `mpc_mul (x, x, x,
308 rnd_mode)'. This computes the square of X with rounding mode `rnd_mode'
309 and puts the result back in X.
311 Before you can assign to an MPC variable, you need to initialize it
312 by calling one of the special initialization functions. When you are
313 done with a variable, you need to clear it out, using one of the
314 functions for that purpose.
316 A variable should only be initialized once, or at least cleared out
317 between each initialization. After a variable has been initialized, it
318 may be assigned to any number of times.
320 For efficiency reasons, avoid to initialize and clear out a variable
321 in loops. Instead, initialize it before entering the loop, and clear
322 it out after the loop has exited.
324 You do not need to be concerned about allocating additional space
325 for MPC variables, since each of its real and imaginary part has a
326 mantissa of fixed size. Hence unless you change its precision, or
327 clear and reinitialize it, a complex variable will have the same
328 allocated space during all its life.
333 A complex rounding mode is of the form `MPC_RNDxy' where `x' and `y'
334 are one of `N' (to nearest), `Z' (towards zero), `U' (towards plus
335 infinity), `D' (towards minus infinity). The first letter refers to
336 the rounding mode for the real part, and the second one for the
337 imaginary part. For example `MPC_RNDZU' indicates to round the real
338 part towards zero, and the imaginary part towards plus infinity.
340 The `round to nearest' mode works as in the IEEE P754 standard: in
341 case the number to be rounded lies exactly in the middle of two
342 representable numbers, it is rounded to the one with the least
343 significant bit set to zero. For example, the number 5, which is
344 represented by (101) in binary, is rounded to (100)=4 with a precision
345 of two bits, and not to (110)=6.
350 Most MPC functions have a return value of type `int', which is used to
351 indicate the position of the rounded real and imaginary parts with
352 respect to the exact (infinite precision) values. If this integer is
353 `i', the macros `MPC_INEX_RE(i)' and `MPC_INEX_IM(i)' give 0 if the
354 corresponding rounded value is exact, a negative value if the rounded
355 value is less than the exact one, and a positive value if it is greater
356 than the exact one. Similarly, functions computing a result of type
357 `mpfr_t' return an integer that is 0, positive or negative depending on
358 whether the rounded value is the same, larger or smaller then the exact
361 Some functions, such as `mpc_sin_cos', compute two complex results;
362 the macros `MPC_INEX1(i)' and `MPC_INEX2(i)', applied to the return
363 value `i' of such a function, yield the exactness value corresponding
364 to the first or the second computed value, respectively.
366 4.6 Branch Cuts And Special Values
367 ==================================
369 Some complex functions have branch cuts, across which the function is
370 discontinous. In MPC, the branch cuts chosen are the same as those
371 specified for the corresponding functions in the ISO C99 standard.
373 Likewise, when evaluated at a point whose real or imaginary part is
374 either infinite or a NaN or a signed zero, a function returns the same
375 value as those specified for the corresponding function in the ISO C99
379 File: mpc.info, Node: Complex Functions, Next: Contributors, Prev: MPC Basics, Up: Top
384 The complex functions expect arguments of type `mpc_t'.
386 The MPC floating-point functions have an interface that is similar
387 to the GNU MP integer functions. The function prefix for operations on
388 complex numbers is `mpc_'.
390 The precision of a computation is defined as follows: Compute the
391 requested operation exactly (with "infinite precision"), and round the
392 result to the destination variable precision with the given rounding
395 The MPC complex functions are intended to be a smooth extension of
396 the IEEE P754 arithmetic. The results obtained on one computer should
397 not differ from the results obtained on a computer with a different
402 * Initializing Complex Numbers::
403 * Assigning Complex Numbers::
404 * Converting Complex Numbers::
405 * String and Stream Input and Output::
406 * Complex Comparison::
407 * Projection & Decomposing::
409 * Power Functions and Logarithm::
410 * Trigonometric Functions::
411 * Miscellaneous Complex Functions::
412 * Advanced Functions::
416 File: mpc.info, Node: Initializing Complex Numbers, Next: Assigning Complex Numbers, Prev: Complex Functions, Up: Complex Functions
418 5.1 Initialization Functions
419 ============================
421 An `mpc_t' object must be initialized before storing the first value in
422 it. The functions `mpc_init2' and `mpc_init3' are used for that
425 -- Function: void mpc_init2 (mpc_t Z, mpfr_prec_t PREC)
426 Initialize Z to precision PREC bits and set its real and imaginary
427 parts to NaN. Normally, a variable should be initialized once only
428 or at least be cleared, using `mpc_clear', between initializations.
430 -- Function: void mpc_init3 (mpc_t Z, mpfr_prec_t PREC_R, mpfr_prec_t
432 Initialize Z with the precision of its real part being PREC_R bits
433 and the precision of its imaginary part being PREC_I bits, and set
434 the real and imaginary parts to NaN.
436 -- Function: void mpc_clear (mpc_t Z)
437 Free the space occupied by Z. Make sure to call this function for
438 all `mpc_t' variables when you are done with them.
440 Here is an example on how to initialize complex variables:
443 mpc_init2 (x, 256); /* precision _exactly_ 256 bits */
444 mpc_init3 (y, 100, 50); /* 100/50 bits for the real/imaginary part */
450 The following function is useful for changing the precision during a
451 calculation. A typical use would be for adjusting the precision
452 gradually in iterative algorithms like Newton-Raphson, making the
453 computation precision closely match the actual accurate part of the
456 -- Function: void mpc_set_prec (mpc_t X, mpfr_prec_t PREC)
457 Reset the precision of X to be *exactly* PREC bits, and set its
458 real/imaginary parts to NaN. The previous value stored in X is
459 lost. It is equivalent to a call to `mpc_clear(x)' followed by a
460 call to `mpc_init2(x, prec)', but more efficient as no allocation
461 is done in case the current allocated space for the mantissa of X
464 -- Function: mpfr_prec_t mpc_get_prec (mpc_t X)
465 If the real and imaginary part of X have the same precision, it is
466 returned, otherwise, 0 is returned.
468 -- Function: void mpc_get_prec2 (mpfr_prec_t* PR, mpfr_prec_t* PI,
470 Returns the precision of the real part of X via PR and of its
471 imaginary part via PI.
474 File: mpc.info, Node: Assigning Complex Numbers, Next: Converting Complex Numbers, Prev: Initializing Complex Numbers, Up: Complex Functions
476 5.2 Assignment Functions
477 ========================
479 These functions assign new values to already initialized complex numbers
480 (*note Initializing Complex Numbers::). When using any functions with
481 `intmax_t' or `uintmax_t' parameters, you must include `<stdint.h>' or
482 `<inttypes.h>' _before_ `mpc.h', to allow `mpc.h' to define prototypes
483 for these functions. Similarly, functions with parameters of type
484 `complex' or `long complex' are defined only if `<complex.h>' is
485 included _before_ `mpc.h'. If you need assignment functions that are
486 not in the current API, you can define them using the `MPC_SET_X_Y'
487 macro (*note Advanced Functions::).
489 -- Function: int mpc_set (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
490 Set the value of ROP from OP, rounded to the precision of ROP with
491 the given rounding mode RND.
493 -- Function: int mpc_set_ui (mpc_t ROP, unsigned long int OP,
495 -- Function: int mpc_set_si (mpc_t ROP, long int OP, mpc_rnd_t RND)
496 -- Function: int mpc_set_uj (mpc_t ROP, uintmax_t OP, mpc_rnd_t RND)
497 -- Function: int mpc_set_sj (mpc_t ROP, intmax_t OP, mpc_rnd_t RND)
498 -- Function: int mpc_set_d (mpc_t ROP, double OP, mpc_rnd_t RND)
499 -- Function: int mpc_set_ld (mpc_t ROP, long double OP, mpc_rnd_t RND)
500 -- Function: int mpc_set_dc (mpc_t ROP, double _Complex OP, mpc_rnd_t
502 -- Function: int mpc_set_ldc (mpc_t ROP, long double _Complex OP,
504 -- Function: int mpc_set_z (mpc_t ROP, mpz_t OP mpc_rnd_t RND)
505 -- Function: int mpc_set_q (mpc_t ROP, mpq_t OP mpc_rnd_t RND)
506 -- Function: int mpc_set_f (mpc_t ROP, mpf_t OP mpc_rnd_t RND)
507 -- Function: int mpc_set_fr (mpc_t ROP, mpfr_t OP, mpc_rnd_t RND)
508 Set the value of ROP from OP, rounded to the precision of ROP with
509 the given rounding mode RND. The argument OP is interpreted as
510 real, so the imaginary part of ROP is set to zero with a positive
511 sign. Please note that even a `long int' may have to be rounded,
512 if the destination precision is less than the machine word width.
513 For `mpc_set_d', be careful that the input number OP may not be
514 exactly representable as a double-precision number (this happens
515 for 0.1 for instance), in which case it is first rounded by the C
516 compiler to a double-precision number, and then only to a complex
519 -- Function: int mpc_set_ui_ui (mpc_t ROP, unsigned long int OP1,
520 unsigned long int OP2, mpc_rnd_t RND)
521 -- Function: int mpc_set_si_si (mpc_t ROP, long int OP1, long int OP2,
523 -- Function: int mpc_set_uj_uj (mpc_t ROP, uintmax_t OP1, uintmax_t
525 -- Function: int mpc_set_sj_sj (mpc_t ROP, intmax_t OP1, intmax_t OP2,
527 -- Function: int mpc_set_d_d (mpc_t ROP, double OP1, double OP2,
529 -- Function: int mpc_set_ld_ld (mpc_t ROP, long double OP1, long
530 double OP2, mpc_rnd_t RND)
531 -- Function: int mpc_set_z_z (mpc_t ROP, mpz_t OP1, mpz_t OP2,
533 -- Function: int mpc_set_q_q (mpc_t ROP, mpq_t OP1, mpq_t OP2,
535 -- Function: int mpc_set_f_f (mpc_t ROP, mpf_t OP1, mpf_t OP2,
537 -- Function: int mpc_set_fr_fr (mpc_t ROP, mpfr_t OP1, mpfr_t OP2,
539 Set the real part of ROP from OP1, and its imaginary part from
540 OP2, according to the rounding mode RND.
542 Beware that the behaviour of `mpc_set_fr_fr' is undefined if OP1
543 or OP2 is a pointer to the real or imaginary part of ROP. To
544 exchange the real and the imaginary part of a complex number,
545 either use `mpfr_swap (mpc_realref (rop), mpc_imagref (rop))',
546 which also exchanges the precisions of the two parts; or use a
549 For functions assigning complex variables from strings or input
550 streams, *note String and Stream Input and Output: string-io.
552 -- Function: void mpc_set_nan (mpc_t ROP)
553 Set ROP to Nan+i*NaN.
555 -- Function: void mpc_swap (mpc_t OP1, mpc_t OP2)
556 Swap the values of OP1 and OP2 efficiently. Warning: The
557 precisions are exchanged, too; in case these are different,
558 `mpc_swap' is thus not equivalent to three `mpc_set' calls using a
559 third auxiliary variable.
562 File: mpc.info, Node: Converting Complex Numbers, Next: String and Stream Input and Output, Prev: Assigning Complex Numbers, Up: Complex Functions
564 5.3 Conversion Functions
565 ========================
567 The following functions are available only if `<complex.h>' is included
570 -- Function: double _Complex mpc_get_dc (mpc_t OP, mpc_rnd_t RND)
571 -- Function: long double _Complex mpc_get_ldc (mpc_t OP, mpc_rnd_t RND)
572 Convert OP to a C complex number, using the rounding mode RND.
574 For functions converting complex variables to strings or stream
575 output, *note String and Stream Input and Output: string-io.
578 File: mpc.info, Node: String and Stream Input and Output, Next: Complex Comparison, Prev: Converting Complex Numbers, Up: Complex Functions
580 5.4 String and Stream Input and Output
581 ======================================
583 -- Function: int mpc_strtoc (mpc_t ROP, const char *NPTR, char
584 **ENDPTR, int BASE, mpc_rnd_t RND)
585 Read a complex number from a string NPTR in base BASE, rounded to
586 the precision of ROP with the given rounding mode RND. The BASE
587 must be either 0 or a number from 2 to 36 (otherwise the behaviour
588 is undefined). If NPTR starts with valid data, the result is
589 stored in ROP, the usual inexact value is returned (*note Return
590 Value: return-value.) and, if ENDPTR is not the null pointer,
591 *ENDPTR points to the character just after the valid data.
592 Otherwise, ROP is set to `NaN + i * NaN', -1 is returned and, if
593 ENDPTR is not the null pointer, the value of NPTR is stored in the
594 location referenced by ENDPTR.
596 The expected form of a complex number string is either a real
597 number (an optional leading whitespace, an optional sign followed
598 by a floating-point number), or a pair of real numbers in
599 parentheses separated by whitespace. If a real number is read, the
600 missing imaginary part is set to +0. The form of a floating-point
601 number depends on the base and is described in the documentation
602 of `mpfr_strtofr' (*note Assignment Functions:
603 (mpfr.info)Assignment Functions.). For instance, `"3.1415926"',
604 `"(1.25e+7 +.17)"', `"(@nan@ 2)"' and `"(-0 -7)"' are valid
605 strings for BASE = 10. If BASE = 0, then a prefix may be used to
606 indicate the base in which the floating-point number is written.
607 Use prefix '0b' for binary numbers, prefix '0x' for hexadecimal
608 numbers, and no prefix for decimal numbers. The real and
609 imaginary part may then be written in different bases. For
610 instance, `"(1.024e+3 +2.05e+3)"' and `"(0b1p+10 +0x802)"' are
611 valid strings for `base'=0 and represent the same value.
613 -- Function: int mpc_set_str (mpc_t ROP, const char *S, int BASE,
615 Set ROP to the value of the string S in base BASE, rounded to the
616 precision of ROP with the given rounding mode RND. See the
617 documentation of `mpc_strtoc' for a detailed description of the
618 valid string formats. Contrarily to `mpc_strtoc', `mpc_set_str'
619 requires the _whole_ string to represent a valid complex number
620 (potentially followed by additional white space). This function
621 returns the usual inexact value (*note Return Value:
622 return-value.) if the entire string up to the final null character
623 is a valid number in base BASE; otherwise it returns -1, and ROP
626 -- Function: char * mpc_get_str (int B, size_t N, mpc_t OP, mpc_rnd_t
628 Convert OP to a string containing its real and imaginary parts,
629 separated by a space and enclosed in a pair of parentheses. The
630 numbers are written in base B (which may vary from 2 to 36) and
631 rounded according to RND. The number of significant digits, at
632 least 2, is given by N. It is also possible to let N be zero, in
633 which case the number of digits is chosen large enough so that
634 re-reading the printed value with the same precision, assuming
635 both output and input use rounding to nearest, will recover the
636 original value of OP. Note that `mpc_get_str' uses the decimal
637 point of the current locale if available, and `.' otherwise.
639 The string is generated using the current memory allocation
640 function (`malloc' by default, unless it has been modified using
641 the custom memory allocation interface of `gmp'); once it is not
642 needed any more, it should be freed by calling `mpc_free_str'.
644 -- Function: void mpc_free_str (char *STR)
645 Free the string STR, which needs to have been allocated by a call
648 The following two functions read numbers from input streams and write
649 them to output streams. When using any of these functions, you need to
650 include `stdio.h' _before_ `mpc.h'.
652 -- Function: int mpc_inp_str (mpc_t ROP, FILE *STREAM, size_t *READ,
653 int BASE, mpc_rnd_t RND)
654 Input a string in base BASE in the same format as for `mpc_strtoc'
655 from stdio stream STREAM, rounded according to RND, and put the
656 read complex number into ROP. If STREAM is the null pointer, ROP
657 is read from `stdin'. Return the usual inexact value; if an error
658 occurs, set ROP to `NaN + i * NaN' and return -1. If READ is not
659 the null pointer, it is set to the number of read characters.
661 Unlike `mpc_strtoc', the function `mpc_inp_str' does not possess
662 perfect knowledge of the string to transform and has to read it
663 character by character, so it behaves slightly differently: It
664 tries to read a string describing a complex number and processes
665 this string through a call to `mpc_set_str'. Precisely, after
666 skipping optional whitespace, a minimal string is read according
667 to the regular expression `mpfr | '(' \s* mpfr \s+ mpfr \s* ')'',
668 where `\s' denotes a whitespace, and `mpfr' is either a string
669 containing neither whitespaces nor parentheses, or
670 `nan(n-char-sequence)' or `@nan@(n-char-sequence)' (regardless of
671 capitalisation) with `n-char-sequence' a string of ascii letters,
674 For instance, upon input of `"nan(13 1)"', the function
675 `mpc_inp_str' starts to recognise a value of NaN followed by an
676 n-char-sequence indicated by the opening parenthesis; as soon as
677 the space is reached, it becocmes clear that the expression in
678 parentheses is not an n-char-sequence, and the error flag -1 is
679 returned after 6 characters have been consumed from the stream
680 (the whitespace itself remaining in the stream). The function
681 `mpc_strtoc', on the other hand, may track back when reaching the
682 whitespace; it treats the string as the two successive complex
683 numbers `NaN + i * 0' and `13 + i'. It is thus recommended to
684 have a whitespace follow each floating point number to avoid this
687 -- Function: size_t mpc_out_str (FILE *STREAM, int BASE, size_t
688 N_DIGITS, mpc_t OP, mpc_rnd_t RND)
689 Output OP on stdio stream STREAM in base BASE, rounded according
690 to RND, in the same format as for `mpc_strtoc' If STREAM is the
691 null pointer, ROP is written to `stdout'.
693 Return the number of characters written.
696 File: mpc.info, Node: Complex Comparison, Next: Projection & Decomposing, Prev: String and Stream Input and Output, Up: Complex Functions
698 5.5 Comparison Functions
699 ========================
701 -- Function: int mpc_cmp (mpc_t OP1, mpc_t OP2)
702 -- Function: int mpc_cmp_si_si (mpc_t OP1, long int OP2R, long int
704 -- Macro: int mpc_cmp_si (mpc_t OP1, long int OP2)
705 Compare OP1 and OP2, where in the case of `mpc_cmp_si_si', OP2 is
706 taken to be OP2R + i OP2I. The return value C can be decomposed
707 into `x = MPC_INEX_RE(c)' and `y = MPC_INEX_IM(c)', such that X is
708 positive if the real part of OP1 is greater than that of OP2, zero
709 if both real parts are equal, and negative if the real part of OP1
710 is less than that of OP2, and likewise for Y. Both OP1 and OP2
711 are considered to their full own precision, which may differ. It
712 is not allowed that one of the operands has a NaN (Not-a-Number)
715 The storage of the return value is such that equality can be
716 simply checked with `mpc_cmp (op1, op2) == 0'.
719 File: mpc.info, Node: Projection & Decomposing, Next: Basic Arithmetic, Prev: Complex Comparison, Up: Complex Functions
721 5.6 Projection and Decomposing Functions
722 ========================================
724 -- Function: int mpc_real (mpfr_t ROP, mpc_t OP, mpfr_rnd_t RND)
725 Set ROP to the value of the real part of OP rounded in the
728 -- Function: int mpc_imag (mpfr_t ROP, mpc_t OP, mpfr_rnd_t RND)
729 Set ROP to the value of the imaginary part of OP rounded in the
732 -- Macro: mpfr_t mpc_realref (mpc_t OP)
733 -- Macro: mpfr_t mpc_imagref (mpc_t OP)
734 Return a reference to the real part and imaginary part of OP,
735 respectively. The `mpfr' functions can be used on the result of
736 these macros (note that the `mpfr_t' type is itself a pointer).
738 -- Function: int mpc_arg (mpfr_t ROP, mpc_t OP, mpfr_rnd_t RND)
739 Set ROP to the argument of OP, with a branch cut along the
742 -- Function: int mpc_proj (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
743 Compute a projection of OP onto the Riemann sphere. Set ROP to OP
744 rounded in the direction RND, except when at least one part of OP
745 is infinite (even if the other part is a NaN) in which case the
746 real part of ROP is set to plus infinity and its imaginary part to
747 a signed zero with the same sign as the imaginary part of OP.
750 File: mpc.info, Node: Basic Arithmetic, Next: Power Functions and Logarithm, Prev: Projection & Decomposing, Up: Complex Functions
752 5.7 Basic Arithmetic Functions
753 ==============================
755 All the following functions are designed in such a way that, when
756 working with real numbers instead of complex numbers, their complexity
757 should essentially be the same as with the MPFR library, with only a
758 marginal overhead due to the MPC layer.
760 -- Function: int mpc_add (mpc_t ROP, mpc_t OP1, mpc_t OP2, mpc_rnd_t
762 -- Function: int mpc_add_ui (mpc_t ROP, mpc_t OP1, unsigned long int
764 -- Function: int mpc_add_fr (mpc_t ROP, mpc_t OP1, mpfr_t OP2,
766 Set ROP to OP1 + OP2 rounded according to RND.
768 -- Function: int mpc_sub (mpc_t ROP, mpc_t OP1, mpc_t OP2, mpc_rnd_t
770 -- Function: int mpc_sub_fr (mpc_t ROP, mpc_t OP1, mpfr_t OP2,
772 -- Function: int mpc_fr_sub (mpc_t ROP, mpfr_t OP1, mpc_t OP2,
774 -- Function: int mpc_sub_ui (mpc_t ROP, mpc_t OP1, unsigned long int
776 -- Macro: int mpc_ui_sub (mpc_t ROP, unsigned long int OP1, mpc_t OP2,
778 -- Function: int mpc_ui_ui_sub (mpc_t ROP, unsigned long int RE1,
779 unsigned long int IM1, mpc_t OP2, mpc_rnd_t RND)
780 Set ROP to OP1 - OP2 rounded according to RND. For
781 `mpc_ui_ui_sub', OP1 is RE1 + IM1.
783 -- Function: int mpc_mul (mpc_t ROP, mpc_t OP1, mpc_t OP2, mpc_rnd_t
785 -- Function: int mpc_mul_ui (mpc_t ROP, mpc_t OP1, unsigned long int
787 -- Function: int mpc_mul_si (mpc_t ROP, mpc_t OP1, long int OP2,
789 -- Function: int mpc_mul_fr (mpc_t ROP, mpc_t OP1, mpfr_t OP2,
791 Set ROP to OP1 times OP2 rounded according to RND.
793 -- Function: int mpc_mul_i (mpc_t ROP, mpc_t OP, int SGN, mpc_rnd_t
795 Set ROP to OP times the imaginary unit i if SGN is non-negative,
796 set ROP to OP times -i otherwise, in both cases rounded according
799 -- Function: int mpc_sqr (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
800 Set ROP to the square of OP rounded according to RND.
802 -- Function: int mpc_div (mpc_t ROP, mpc_t OP1, mpc_t OP2, mpc_rnd_t
804 -- Function: int mpc_div_ui (mpc_t ROP, mpc_t OP1, unsigned long int
806 -- Function: int mpc_ui_div (mpc_t ROP, unsigned long int OP1, mpc_t
808 -- Function: int mpc_div_fr (mpc_t ROP, mpc_t OP1, mpfr_t OP2,
810 -- Function: int mpc_fr_div (mpc_t ROP, mpfr_t OP1, mpc_t OP2,
812 Set ROP to OP1/OP2 rounded according to RND. For `mpc_div' and
813 `mpc_ui_div', the return value may fail to recognize some exact
814 results. The sign of returned value is significant only for
817 -- Function: int mpc_neg (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
818 Set ROP to -OP rounded according to RND. Just changes the sign if
819 ROP and OP are the same variable.
821 -- Function: int mpc_conj (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
822 Set ROP to the conjugate of OP rounded according to RND. Just
823 changes the sign of the imaginary part if ROP and OP are the same
826 -- Function: int mpc_abs (mpfr_t ROP, mpc_t OP, mpfr_rnd_t RND)
827 Set the floating-point number ROP to the absolute value of OP,
828 rounded in the direction RND. The returned value is zero iff the
831 -- Function: int mpc_norm (mpfr_t ROP, mpc_t OP, mpfr_rnd_t RND)
832 Set the floating-point number ROP to the norm of OP (i.e., the
833 square of its absolute value), rounded in the direction RND. The
834 returned value is zero iff the result is exact. Note that the
835 destination is of type `mpfr_t', not `mpc_t'.
837 -- Function: int mpc_mul_2exp (mpc_t ROP, mpc_t OP1, unsigned long int
839 Set ROP to OP1 times 2 raised to OP2 rounded according to RND.
840 Just increases the exponents of the real and imaginary parts by OP2
841 when ROP and OP1 are identical.
843 -- Function: int mpc_div_2exp (mpc_t ROP, mpc_t OP1, unsigned long int
845 Set ROP to OP1 divided by 2 raised to OP2 rounded according to
846 RND. Just decreases the exponents of the real and imaginary parts
847 by OP2 when ROP and OP1 are identical.
849 -- Function: int mpc_fma (mpc_t ROP, mpc_t OP1, mpc_t OP2, mpc_t OP3,
851 Set ROP to OP1 times OP2 plus OP3, rounded according to RND, with
852 only one final rounding.
855 File: mpc.info, Node: Power Functions and Logarithm, Next: Trigonometric Functions, Prev: Basic Arithmetic, Up: Complex Functions
857 5.8 Power Functions and Logarithm
858 =================================
860 -- Function: int mpc_sqrt (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
861 Set ROP to the square root of OP rounded according to RND.
863 -- Function: int mpc_pow (mpc_t ROP, mpc_t OP1, mpc_t OP2, mpc_rnd_t
865 -- Function: int mpc_pow_d (mpc_t ROP, mpc_t OP1, double OP2,
867 -- Function: int mpc_pow_ld (mpc_t ROP, mpc_t OP1, long double OP2,
869 -- Function: int mpc_pow_si (mpc_t ROP, mpc_t OP1, long OP2, mpc_rnd_t
871 -- Function: int mpc_pow_ui (mpc_t ROP, mpc_t OP1, unsigned long OP2,
873 -- Function: int mpc_pow_z (mpc_t ROP, mpc_t OP1, mpz_t OP2, mpc_rnd_t
875 -- Function: int mpc_pow_fr (mpc_t ROP, mpc_t OP1, mpfr_t OP2,
877 Set ROP to OP1 raised to the power OP2, rounded according to RND.
878 For `mpc_pow_d', `mpc_pow_ld', `mpc_pow_si', `mpc_pow_ui',
879 `mpc_pow_z' and `mpc_pow_fr', the imaginary part of OP2 is
882 -- Function: int mpc_exp (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
883 Set ROP to the exponential of OP, rounded according to RND with
884 the precision of ROP.
886 -- Function: int mpc_log (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
887 Set ROP to the logarithm of OP, rounded according to RND with the
888 precision of ROP. The principal branch is chosen, with the branch
889 cut on the negative real axis, so that the imaginary part of the
890 result lies in ]-\pi , \pi].
893 File: mpc.info, Node: Trigonometric Functions, Next: Miscellaneous Complex Functions, Prev: Power Functions and Logarithm, Up: Complex Functions
895 5.9 Trigonometric Functions
896 ===========================
898 -- Function: int mpc_sin (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
899 Set ROP to the sine of OP, rounded according to RND with the
902 -- Function: int mpc_cos (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
903 Set ROP to the cosine of OP, rounded according to RND with the
906 -- Function: int mpc_sin_cos (mpc_t ROP_SIN, mpc_t ROP_COS, mpc_t OP,
907 mpc_rnd_t RND_SIN, mpc_rnd_t RND_COS)
908 Set ROP_SIN to the sine of OP, rounded according to RND_SIN with
909 the precision of ROP_SIN, and ROP_COS to the cosine of OP, rounded
910 according to RND_COS with the precision of ROP_COS.
912 -- Function: int mpc_tan (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
913 Set ROP to the tangent of OP, rounded according to RND with the
916 -- Function: int mpc_sinh (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
917 Set ROP to the hyperbolic sine of OP, rounded according to RND
918 with the precision of ROP.
920 -- Function: int mpc_cosh (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
921 Set ROP to the hyperbolic cosine of OP, rounded according to RND
922 with the precision of ROP.
924 -- Function: int mpc_tanh (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
925 Set ROP to the hyperbolic tangent of OP, rounded according to RND
926 with the precision of ROP.
928 -- Function: int mpc_asin (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
929 -- Function: int mpc_acos (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
930 -- Function: int mpc_atan (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
931 Set ROP to the inverse sine, inverse cosine, inverse tangent of OP,
932 rounded according to RND with the precision of ROP.
934 -- Function: int mpc_asinh (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
935 -- Function: int mpc_acosh (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
936 -- Function: int mpc_atanh (mpc_t ROP, mpc_t OP, mpc_rnd_t RND)
937 Set ROP to the inverse hyperbolic sine, inverse hyperbolic cosine,
938 inverse hyperbolic tangent of OP, rounded according to RND with
939 the precision of ROP. The branch cut of MPC_ACOSH is (-\infty, 1).
942 File: mpc.info, Node: Miscellaneous Complex Functions, Next: Advanced Functions, Prev: Trigonometric Functions, Up: Complex Functions
944 5.10 Miscellaneous Functions
945 ============================
947 -- Function: int mpc_urandom (mpc_t ROP, gmp_randstate_t STATE)
948 Generate a uniformly distributed random complex in the unit square
949 [0, 1] * [0, 1]. Return 0, unless an exponent in the real or
950 imaginary part is not in the current exponent range, in which case
951 that part is set to NaN and a zero value is returned. The second
952 argument is a `gmp_randstate_t' structure which should be created
953 using the GMP `rand_init' function, see the GMP manual.
955 -- Function: const char * mpc_get_version (void)
956 Return the MPC version, as a null-terminated string.
958 -- Macro: MPC_VERSION
959 -- Macro: MPC_VERSION_MAJOR
960 -- Macro: MPC_VERSION_MINOR
961 -- Macro: MPC_VERSION_PATCHLEVEL
962 -- Macro: MPC_VERSION_STRING
963 `MPC_VERSION' is the version of MPC as a preprocessing constant.
964 `MPC_VERSION_MAJOR', `MPC_VERSION_MINOR' and
965 `MPC_VERSION_PATCHLEVEL' are respectively the major, minor and
966 patch level of MPC version, as preprocessing constants.
967 `MPC_VERSION_STRING' is the version as a string constant, which
968 can be compared to the result of `mpc_get_version' to check at run
969 time the header file and library used match:
970 if (strcmp (mpc_get_version (), MPC_VERSION_STRING))
971 fprintf (stderr, "Warning: header and library do not match\n");
972 Note: Obtaining different strings is not necessarily an error, as
973 in general, a program compiled with some old MPC version can be
974 dynamically linked with a newer MPC library version (if allowed by
975 the library versioning system).
977 -- Macro: long MPC_VERSION_NUM (MAJOR, MINOR, PATCHLEVEL)
978 Create an integer in the same format as used by `MPC_VERSION' from
979 the given MAJOR, MINOR and PATCHLEVEL. Here is an example of how
980 to check the MPC version at compile time:
981 #if (!defined(MPC_VERSION) || (MPC_VERSION<MPC_VERSION_NUM(2,1,0)))
982 # error "Wrong MPC version."
986 File: mpc.info, Node: Advanced Functions, Next: Internals, Prev: Miscellaneous Complex Functions, Up: Complex Functions
988 5.11 Advanced Functions
989 =======================
991 -- Macro: MPC_SET_X_Y (REAL_SUFFIX, IMAG_SUFFIX, ROP, REAL, IMAG, RND)
992 The macro MPC_SET_X_Y is designed to serve as the body of an
993 assignment function and cannot be used by itself. The REAL_SUFFIX
994 and IMAG_SUFFIX parameters are the types of the real and imaginary
995 part, that is, the `x' in the `mpfr_set_x' function one would use
996 to set the part; for the mpfr type, use `fr'. REAL (respectively
997 IMAG) is the value you want to assign to the real (resp.
998 imaginary) part, its type must conform to REAL_SUFFIX (resp.
999 IMAG_SUFFIX). RND is the `mpc_rnd_t' rounding mode. The return
1000 value is the usual inexact value (*note Return Value:
1003 For instance, you can define mpc_set_ui_fr as follows:
1004 int mpc_set_ui_fr (mpc_t rop, long int re, double im, mpc_rnd_t rnd)
1005 MPC_SET_X_Y (ui, fr, rop, re, im, rnd);
1008 File: mpc.info, Node: Internals, Prev: Advanced Functions, Up: Complex Functions
1013 These macros and functions are mainly designed for the implementation
1014 of MPC, but may be useful for users too. However, no upward
1015 compatibility is guaranteed. You need to include `mpc-impl.h' to use
1018 The macro `MPC_MAX_PREC(z)' gives the maximum of the precisions of
1019 the real and imaginary parts of a complex number.
1022 File: mpc.info, Node: Contributors, Next: References, Prev: Complex Functions, Up: Top
1027 The main developers of the MPC library are Andreas Enge, Philippe
1028 The'veny and Paul Zimmermann. Patrick Pe'lissier has helped cleaning
1029 up the code. Marc Helbling contributed the `mpc_ui_sub' and
1030 `mpc_ui_ui_sub' functions.
1033 File: mpc.info, Node: References, Next: Concept Index, Prev: Contributors, Up: Top
1038 * Torbjo"rn Granlund et al. `gmp' - GNU multiprecision library.
1039 Version 4.2.4, `http://gmplib.org/'.
1041 * Guillaume Hanrot, Vincent Lefe`vre, Patrick Pe'lissier, Paul
1042 Zimmermann et al. `mpfr' - A library for multiple-precision
1043 floating-point computations with exact rounding.
1044 Version 2.4.1, `http://www.mpfr.org'.
1046 * IEEE standard for binary floating-point arithmetic, Technical
1047 Report ANSI-IEEE Standard 754-1985, New York, 1985. Approved
1048 March 21, 1985: IEEE Standards Board; approved July 26, 1985:
1049 American National Standards Institute, 18 pages.
1051 * Donald E. Knuth, "The Art of Computer Programming", vol 2,
1052 "Seminumerical Algorithms", 2nd edition, Addison-Wesley, 1981.
1054 * ISO/IEC 9899:1999, Programming languages — C.
1058 File: mpc.info, Node: Concept Index, Next: Function Index, Prev: References, Up: Top
1066 * Arithmetic functions: Basic Arithmetic. (line 6)
1067 * Comparison functions: Complex Comparison. (line 3)
1068 * Complex arithmetic functions: Basic Arithmetic. (line 6)
1069 * Complex assignment functions: Assigning Complex Numbers.
1071 * Complex comparisons functions: Complex Comparison. (line 3)
1072 * Complex functions: Complex Functions. (line 6)
1073 * Complex number: MPC Basics. (line 15)
1074 * Conditions for copying MPC: Copying. (line 6)
1075 * Conversion functions: Converting Complex Numbers.
1077 * Copying conditions: Copying. (line 6)
1078 * Installation: Installing MPC. (line 6)
1079 * Logarithm: Power Functions and Logarithm.
1081 * Miscellaneous complex functions: Miscellaneous Complex Functions.
1083 * mpc.h: MPC Basics. (line 6)
1084 * Power functions: Power Functions and Logarithm.
1086 * Precision: MPC Basics. (line 19)
1087 * Projection and Decomposing Functions: Projection & Decomposing.
1089 * Reporting bugs: Reporting Bugs. (line 6)
1090 * Rounding Mode: MPC Basics. (line 24)
1091 * String and stream input and output: String and Stream Input and Output.
1093 * Trigonometric functions: Trigonometric Functions.
1095 * User-defined precision: Complex Functions. (line 12)
1098 File: mpc.info, Node: Function Index, Prev: Concept Index, Up: Top
1100 Function and Type Index
1101 ***********************
1106 * _Complex: Converting Complex Numbers.
1108 * mpc_abs: Basic Arithmetic. (line 78)
1109 * mpc_acos: Trigonometric Functions.
1111 * mpc_acosh: Trigonometric Functions.
1113 * mpc_add: Basic Arithmetic. (line 13)
1114 * mpc_add_fr: Basic Arithmetic. (line 17)
1115 * mpc_add_ui: Basic Arithmetic. (line 15)
1116 * mpc_arg: Projection & Decomposing.
1118 * mpc_asin: Trigonometric Functions.
1120 * mpc_asinh: Trigonometric Functions.
1122 * mpc_atan: Trigonometric Functions.
1124 * mpc_atanh: Trigonometric Functions.
1126 * mpc_clear: Initializing Complex Numbers.
1128 * mpc_cmp: Complex Comparison. (line 7)
1129 * mpc_cmp_si: Complex Comparison. (line 10)
1130 * mpc_cmp_si_si: Complex Comparison. (line 9)
1131 * mpc_conj: Basic Arithmetic. (line 73)
1132 * mpc_cos: Trigonometric Functions.
1134 * mpc_cosh: Trigonometric Functions.
1136 * mpc_div: Basic Arithmetic. (line 55)
1137 * mpc_div_2exp: Basic Arithmetic. (line 96)
1138 * mpc_div_fr: Basic Arithmetic. (line 61)
1139 * mpc_div_ui: Basic Arithmetic. (line 57)
1140 * mpc_exp: Power Functions and Logarithm.
1142 * mpc_fma: Basic Arithmetic. (line 102)
1143 * mpc_fr_div: Basic Arithmetic. (line 63)
1144 * mpc_fr_sub: Basic Arithmetic. (line 25)
1145 * mpc_free_str: String and Stream Input and Output.
1147 * mpc_get_ldc: Converting Complex Numbers.
1149 * mpc_get_prec: Initializing Complex Numbers.
1151 * mpc_get_prec2: Initializing Complex Numbers.
1153 * mpc_get_str: String and Stream Input and Output.
1155 * mpc_get_version: Miscellaneous Complex Functions.
1157 * mpc_imag: Projection & Decomposing.
1159 * mpc_imagref: Projection & Decomposing.
1161 * mpc_init2: Initializing Complex Numbers.
1163 * mpc_init3: Initializing Complex Numbers.
1165 * mpc_inp_str: String and Stream Input and Output.
1167 * mpc_log: Power Functions and Logarithm.
1169 * mpc_mul: Basic Arithmetic. (line 36)
1170 * mpc_mul_2exp: Basic Arithmetic. (line 90)
1171 * mpc_mul_fr: Basic Arithmetic. (line 42)
1172 * mpc_mul_i: Basic Arithmetic. (line 46)
1173 * mpc_mul_si: Basic Arithmetic. (line 40)
1174 * mpc_mul_ui: Basic Arithmetic. (line 38)
1175 * mpc_neg: Basic Arithmetic. (line 69)
1176 * mpc_norm: Basic Arithmetic. (line 83)
1177 * mpc_out_str: String and Stream Input and Output.
1179 * mpc_pow: Power Functions and Logarithm.
1181 * mpc_pow_d: Power Functions and Logarithm.
1183 * mpc_pow_fr: Power Functions and Logarithm.
1185 * mpc_pow_ld: Power Functions and Logarithm.
1187 * mpc_pow_si: Power Functions and Logarithm.
1189 * mpc_pow_ui: Power Functions and Logarithm.
1191 * mpc_pow_z: Power Functions and Logarithm.
1193 * mpc_proj: Projection & Decomposing.
1195 * mpc_real: Projection & Decomposing.
1197 * mpc_realref: Projection & Decomposing.
1199 * mpc_rnd_t: MPC Basics. (line 24)
1200 * mpc_set: Assigning Complex Numbers.
1202 * mpc_set_d: Assigning Complex Numbers.
1204 * mpc_set_d_d: Assigning Complex Numbers.
1206 * mpc_set_dc: Assigning Complex Numbers.
1208 * mpc_set_f: Assigning Complex Numbers.
1210 * mpc_set_f_f: Assigning Complex Numbers.
1212 * mpc_set_fr: Assigning Complex Numbers.
1214 * mpc_set_fr_fr: Assigning Complex Numbers.
1216 * mpc_set_ld: Assigning Complex Numbers.
1218 * mpc_set_ld_ld: Assigning Complex Numbers.
1220 * mpc_set_ldc: Assigning Complex Numbers.
1222 * mpc_set_nan: Assigning Complex Numbers.
1224 * mpc_set_prec: Initializing Complex Numbers.
1226 * mpc_set_q: Assigning Complex Numbers.
1228 * mpc_set_q_q: Assigning Complex Numbers.
1230 * mpc_set_si: Assigning Complex Numbers.
1232 * mpc_set_si_si: Assigning Complex Numbers.
1234 * mpc_set_sj: Assigning Complex Numbers.
1236 * mpc_set_sj_sj: Assigning Complex Numbers.
1238 * mpc_set_str: String and Stream Input and Output.
1240 * mpc_set_ui: Assigning Complex Numbers.
1242 * mpc_set_ui_ui: Assigning Complex Numbers.
1244 * mpc_set_uj: Assigning Complex Numbers.
1246 * mpc_set_uj_uj: Assigning Complex Numbers.
1248 * MPC_SET_X_Y: Advanced Functions. (line 7)
1249 * mpc_set_z: Assigning Complex Numbers.
1251 * mpc_set_z_z: Assigning Complex Numbers.
1253 * mpc_sin: Trigonometric Functions.
1255 * mpc_sin_cos: Trigonometric Functions.
1257 * mpc_sinh: Trigonometric Functions.
1259 * mpc_sqr: Basic Arithmetic. (line 51)
1260 * mpc_sqrt: Power Functions and Logarithm.
1262 * mpc_strtoc: String and Stream Input and Output.
1264 * mpc_sub: Basic Arithmetic. (line 21)
1265 * mpc_sub_fr: Basic Arithmetic. (line 23)
1266 * mpc_sub_ui: Basic Arithmetic. (line 27)
1267 * mpc_swap: Assigning Complex Numbers.
1269 * mpc_t: MPC Basics. (line 15)
1270 * mpc_tan: Trigonometric Functions.
1272 * mpc_tanh: Trigonometric Functions.
1274 * mpc_ui_div: Basic Arithmetic. (line 59)
1275 * mpc_ui_sub: Basic Arithmetic. (line 29)
1276 * mpc_ui_ui_sub: Basic Arithmetic. (line 31)
1277 * mpc_urandom: Miscellaneous Complex Functions.
1279 * MPC_VERSION: Miscellaneous Complex Functions.
1281 * MPC_VERSION_MAJOR: Miscellaneous Complex Functions.
1283 * MPC_VERSION_MINOR: Miscellaneous Complex Functions.
1285 * MPC_VERSION_NUM: Miscellaneous Complex Functions.
1287 * MPC_VERSION_PATCHLEVEL: Miscellaneous Complex Functions.
1289 * MPC_VERSION_STRING: Miscellaneous Complex Functions.
1291 * mpfr_prec_t: MPC Basics. (line 19)
1297 Node: Copying
\x7f1607
1298 Node: Introduction to MPC
\x7f2265
1299 Node: Installing MPC
\x7f2973
1300 Node: Reporting Bugs
\x7f7632
1301 Node: MPC Basics
\x7f8961
1302 Ref: return-value
\x7f12611
1303 Node: Complex Functions
\x7f14053
1304 Node: Initializing Complex Numbers
\x7f15202
1305 Node: Assigning Complex Numbers
\x7f17616
1306 Node: Converting Complex Numbers
\x7f22024
1307 Node: String and Stream Input and Output
\x7f22658
1308 Ref: string-io
\x7f22805
1309 Node: Complex Comparison
\x7f29237
1310 Node: Projection & Decomposing
\x7f30316
1311 Node: Basic Arithmetic
\x7f31691
1312 Node: Power Functions and Logarithm
\x7f36331
1313 Node: Trigonometric Functions
\x7f37986
1314 Node: Miscellaneous Complex Functions
\x7f40211
1315 Node: Advanced Functions
\x7f42356
1316 Node: Internals
\x7f43429
1317 Node: Contributors
\x7f43876
1318 Node: References
\x7f44222
1319 Node: Concept Index
\x7f45136
1320 Node: Function Index
\x7f47450