mpc.info 86 KB

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