1This is ../../gmp/doc/gmp.info, produced by makeinfo version 4.8 from 2../../gmp/doc/gmp.texi. 3 4 This manual describes how to install and use the GNU multiple 5precision arithmetic library, version 5.0.2. 6 7 Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 82001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free 9Software Foundation, Inc. 10 11 Permission is granted to copy, distribute and/or modify this 12document under the terms of the GNU Free Documentation License, Version 131.3 or any later version published by the Free Software Foundation; 14with no Invariant Sections, with the Front-Cover Texts being "A GNU 15Manual", and with the Back-Cover Texts being "You have freedom to copy 16and modify this GNU Manual, like GNU software". A copy of the license 17is included in *Note GNU Free Documentation License::. 18 19INFO-DIR-SECTION GNU libraries 20START-INFO-DIR-ENTRY 21* gmp: (gmp). GNU Multiple Precision Arithmetic Library. 22END-INFO-DIR-ENTRY 23 24 25File: gmp.info, Node: Jacobi Symbol, Prev: Extended GCD, Up: Greatest Common Divisor Algorithms 26 2716.3.5 Jacobi Symbol 28-------------------- 29 30`mpz_jacobi' and `mpz_kronecker' are currently implemented with a 31simple binary algorithm similar to that described for the GCDs (*note 32Binary GCD::). They're not very fast when both inputs are large. 33Lehmer's multi-step improvement or a binary based multi-step algorithm 34is likely to be better. 35 36 When one operand fits a single limb, and that includes 37`mpz_kronecker_ui' and friends, an initial reduction is done with 38either `mpn_mod_1' or `mpn_modexact_1_odd', followed by the binary 39algorithm on a single limb. The binary algorithm is well suited to a 40single limb, and the whole calculation in this case is quite efficient. 41 42 In all the routines sign changes for the result are accumulated 43using some bit twiddling, avoiding table lookups or conditional jumps. 44 45 46File: gmp.info, Node: Powering Algorithms, Next: Root Extraction Algorithms, Prev: Greatest Common Divisor Algorithms, Up: Algorithms 47 4816.4 Powering Algorithms 49======================== 50 51* Menu: 52 53* Normal Powering Algorithm:: 54* Modular Powering Algorithm:: 55 56 57File: gmp.info, Node: Normal Powering Algorithm, Next: Modular Powering Algorithm, Prev: Powering Algorithms, Up: Powering Algorithms 58 5916.4.1 Normal Powering 60---------------------- 61 62Normal `mpz' or `mpf' powering uses a simple binary algorithm, 63successively squaring and then multiplying by the base when a 1 bit is 64seen in the exponent, as per Knuth section 4.6.3. The "left to right" 65variant described there is used rather than algorithm A, since it's 66just as easy and can be done with somewhat less temporary memory. 67 68 69File: gmp.info, Node: Modular Powering Algorithm, Prev: Normal Powering Algorithm, Up: Powering Algorithms 70 7116.4.2 Modular Powering 72----------------------- 73 74Modular powering is implemented using a 2^k-ary sliding window 75algorithm, as per "Handbook of Applied Cryptography" algorithm 14.85 76(*note References::). k is chosen according to the size of the 77exponent. Larger exponents use larger values of k, the choice being 78made to minimize the average number of multiplications that must 79supplement the squaring. 80 81 The modular multiplies and squares use either a simple division or 82the REDC method by Montgomery (*note References::). REDC is a little 83faster, essentially saving N single limb divisions in a fashion similar 84to an exact remainder (*note Exact Remainder::). 85 86 87File: gmp.info, Node: Root Extraction Algorithms, Next: Radix Conversion Algorithms, Prev: Powering Algorithms, Up: Algorithms 88 8916.5 Root Extraction Algorithms 90=============================== 91 92* Menu: 93 94* Square Root Algorithm:: 95* Nth Root Algorithm:: 96* Perfect Square Algorithm:: 97* Perfect Power Algorithm:: 98 99 100File: gmp.info, Node: Square Root Algorithm, Next: Nth Root Algorithm, Prev: Root Extraction Algorithms, Up: Root Extraction Algorithms 101 10216.5.1 Square Root 103------------------ 104 105Square roots are taken using the "Karatsuba Square Root" algorithm by 106Paul Zimmermann (*note References::). 107 108 An input n is split into four parts of k bits each, so with b=2^k we 109have n = a3*b^3 + a2*b^2 + a1*b + a0. Part a3 must be "normalized" so 110that either the high or second highest bit is set. In GMP, k is kept 111on a limb boundary and the input is left shifted (by an even number of 112bits) to normalize. 113 114 The square root of the high two parts is taken, by recursive 115application of the algorithm (bottoming out in a one-limb Newton's 116method), 117 118 s1,r1 = sqrtrem (a3*b + a2) 119 120 This is an approximation to the desired root and is extended by a 121division to give s,r, 122 123 q,u = divrem (r1*b + a1, 2*s1) 124 s = s1*b + q 125 r = u*b + a0 - q^2 126 127 The normalization requirement on a3 means at this point s is either 128correct or 1 too big. r is negative in the latter case, so 129 130 if r < 0 then 131 r = r + 2*s - 1 132 s = s - 1 133 134 The algorithm is expressed in a divide and conquer form, but as 135noted in the paper it can also be viewed as a discrete variant of 136Newton's method, or as a variation on the schoolboy method (no longer 137taught) for square roots two digits at a time. 138 139 If the remainder r is not required then usually only a few high limbs 140of r and u need to be calculated to determine whether an adjustment to 141s is required. This optimization is not currently implemented. 142 143 In the Karatsuba multiplication range this algorithm is 144O(1.5*M(N/2)), where M(n) is the time to multiply two numbers of n 145limbs. In the FFT multiplication range this grows to a bound of 146O(6*M(N/2)). In practice a factor of about 1.5 to 1.8 is found in the 147Karatsuba and Toom-3 ranges, growing to 2 or 3 in the FFT range. 148 149 The algorithm does all its calculations in integers and the resulting 150`mpn_sqrtrem' is used for both `mpz_sqrt' and `mpf_sqrt'. The extended 151precision given by `mpf_sqrt_ui' is obtained by padding with zero limbs. 152 153 154File: gmp.info, Node: Nth Root Algorithm, Next: Perfect Square Algorithm, Prev: Square Root Algorithm, Up: Root Extraction Algorithms 155 15616.5.2 Nth Root 157--------------- 158 159Integer Nth roots are taken using Newton's method with the following 160iteration, where A is the input and n is the root to be taken. 161 162 1 A 163 a[i+1] = - * ( --------- + (n-1)*a[i] ) 164 n a[i]^(n-1) 165 166 The initial approximation a[1] is generated bitwise by successively 167powering a trial root with or without new 1 bits, aiming to be just 168above the true root. The iteration converges quadratically when 169started from a good approximation. When n is large more initial bits 170are needed to get good convergence. The current implementation is not 171particularly well optimized. 172 173 174File: gmp.info, Node: Perfect Square Algorithm, Next: Perfect Power Algorithm, Prev: Nth Root Algorithm, Up: Root Extraction Algorithms 175 17616.5.3 Perfect Square 177--------------------- 178 179A significant fraction of non-squares can be quickly identified by 180checking whether the input is a quadratic residue modulo small integers. 181 182 `mpz_perfect_square_p' first tests the input mod 256, which means 183just examining the low byte. Only 44 different values occur for 184squares mod 256, so 82.8% of inputs can be immediately identified as 185non-squares. 186 187 On a 32-bit system similar tests are done mod 9, 5, 7, 13 and 17, 188for a total 99.25% of inputs identified as non-squares. On a 64-bit 189system 97 is tested too, for a total 99.62%. 190 191 These moduli are chosen because they're factors of 2^24-1 (or 2^48-1 192for 64-bits), and such a remainder can be quickly taken just using 193additions (see `mpn_mod_34lsub1'). 194 195 When nails are in use moduli are instead selected by the `gen-psqr.c' 196program and applied with an `mpn_mod_1'. The same 2^24-1 or 2^48-1 197could be done with nails using some extra bit shifts, but this is not 198currently implemented. 199 200 In any case each modulus is applied to the `mpn_mod_34lsub1' or 201`mpn_mod_1' remainder and a table lookup identifies non-squares. By 202using a "modexact" style calculation, and suitably permuted tables, 203just one multiply each is required, see the code for details. Moduli 204are also combined to save operations, so long as the lookup tables 205don't become too big. `gen-psqr.c' does all the pre-calculations. 206 207 A square root must still be taken for any value that passes these 208tests, to verify it's really a square and not one of the small fraction 209of non-squares that get through (ie. a pseudo-square to all the tested 210bases). 211 212 Clearly more residue tests could be done, `mpz_perfect_square_p' only 213uses a compact and efficient set. Big inputs would probably benefit 214from more residue testing, small inputs might be better off with less. 215The assumed distribution of squares versus non-squares in the input 216would affect such considerations. 217 218 219File: gmp.info, Node: Perfect Power Algorithm, Prev: Perfect Square Algorithm, Up: Root Extraction Algorithms 220 22116.5.4 Perfect Power 222-------------------- 223 224Detecting perfect powers is required by some factorization algorithms. 225Currently `mpz_perfect_power_p' is implemented using repeated Nth root 226extractions, though naturally only prime roots need to be considered. 227(*Note Nth Root Algorithm::.) 228 229 If a prime divisor p with multiplicity e can be found, then only 230roots which are divisors of e need to be considered, much reducing the 231work necessary. To this end divisibility by a set of small primes is 232checked. 233 234 235File: gmp.info, Node: Radix Conversion Algorithms, Next: Other Algorithms, Prev: Root Extraction Algorithms, Up: Algorithms 236 23716.6 Radix Conversion 238===================== 239 240Radix conversions are less important than other algorithms. A program 241dominated by conversions should probably use a different data 242representation. 243 244* Menu: 245 246* Binary to Radix:: 247* Radix to Binary:: 248 249 250File: gmp.info, Node: Binary to Radix, Next: Radix to Binary, Prev: Radix Conversion Algorithms, Up: Radix Conversion Algorithms 251 25216.6.1 Binary to Radix 253---------------------- 254 255Conversions from binary to a power-of-2 radix use a simple and fast 256O(N) bit extraction algorithm. 257 258 Conversions from binary to other radices use one of two algorithms. 259Sizes below `GET_STR_PRECOMPUTE_THRESHOLD' use a basic O(N^2) method. 260Repeated divisions by b^n are made, where b is the radix and n is the 261biggest power that fits in a limb. But instead of simply using the 262remainder r from such divisions, an extra divide step is done to give a 263fractional limb representing r/b^n. The digits of r can then be 264extracted using multiplications by b rather than divisions. Special 265case code is provided for decimal, allowing multiplications by 10 to 266optimize to shifts and adds. 267 268 Above `GET_STR_PRECOMPUTE_THRESHOLD' a sub-quadratic algorithm is 269used. For an input t, powers b^(n*2^i) of the radix are calculated, 270until a power between t and sqrt(t) is reached. t is then divided by 271that largest power, giving a quotient which is the digits above that 272power, and a remainder which is those below. These two parts are in 273turn divided by the second highest power, and so on recursively. When 274a piece has been divided down to less than `GET_STR_DC_THRESHOLD' 275limbs, the basecase algorithm described above is used. 276 277 The advantage of this algorithm is that big divisions can make use 278of the sub-quadratic divide and conquer division (*note Divide and 279Conquer Division::), and big divisions tend to have less overheads than 280lots of separate single limb divisions anyway. But in any case the 281cost of calculating the powers b^(n*2^i) must first be overcome. 282 283 `GET_STR_PRECOMPUTE_THRESHOLD' and `GET_STR_DC_THRESHOLD' represent 284the same basic thing, the point where it becomes worth doing a big 285division to cut the input in half. `GET_STR_PRECOMPUTE_THRESHOLD' 286includes the cost of calculating the radix power required, whereas 287`GET_STR_DC_THRESHOLD' assumes that's already available, which is the 288case when recursing. 289 290 Since the base case produces digits from least to most significant 291but they want to be stored from most to least, it's necessary to 292calculate in advance how many digits there will be, or at least be sure 293not to underestimate that. For GMP the number of input bits is 294multiplied by `chars_per_bit_exactly' from `mp_bases', rounding up. 295The result is either correct or one too big. 296 297 Examining some of the high bits of the input could increase the 298chance of getting the exact number of digits, but an exact result every 299time would not be practical, since in general the difference between 300numbers 100... and 99... is only in the last few bits and the work to 301identify 99... might well be almost as much as a full conversion. 302 303 `mpf_get_str' doesn't currently use the algorithm described here, it 304multiplies or divides by a power of b to move the radix point to the 305just above the highest non-zero digit (or at worst one above that 306location), then multiplies by b^n to bring out digits. This is O(N^2) 307and is certainly not optimal. 308 309 The r/b^n scheme described above for using multiplications to bring 310out digits might be useful for more than a single limb. Some brief 311experiments with it on the base case when recursing didn't give a 312noticeable improvement, but perhaps that was only due to the 313implementation. Something similar would work for the sub-quadratic 314divisions too, though there would be the cost of calculating a bigger 315radix power. 316 317 Another possible improvement for the sub-quadratic part would be to 318arrange for radix powers that balanced the sizes of quotient and 319remainder produced, ie. the highest power would be an b^(n*k) 320approximately equal to sqrt(t), not restricted to a 2^i factor. That 321ought to smooth out a graph of times against sizes, but may or may not 322be a net speedup. 323 324 325File: gmp.info, Node: Radix to Binary, Prev: Binary to Radix, Up: Radix Conversion Algorithms 326 32716.6.2 Radix to Binary 328---------------------- 329 330*This section needs to be rewritten, it currently describes the 331algorithms used before GMP 4.3.* 332 333 Conversions from a power-of-2 radix into binary use a simple and fast 334O(N) bitwise concatenation algorithm. 335 336 Conversions from other radices use one of two algorithms. Sizes 337below `SET_STR_PRECOMPUTE_THRESHOLD' use a basic O(N^2) method. Groups 338of n digits are converted to limbs, where n is the biggest power of the 339base b which will fit in a limb, then those groups are accumulated into 340the result by multiplying by b^n and adding. This saves 341multi-precision operations, as per Knuth section 4.4 part E (*note 342References::). Some special case code is provided for decimal, giving 343the compiler a chance to optimize multiplications by 10. 344 345 Above `SET_STR_PRECOMPUTE_THRESHOLD' a sub-quadratic algorithm is 346used. First groups of n digits are converted into limbs. Then adjacent 347limbs are combined into limb pairs with x*b^n+y, where x and y are the 348limbs. Adjacent limb pairs are combined into quads similarly with 349x*b^(2n)+y. This continues until a single block remains, that being 350the result. 351 352 The advantage of this method is that the multiplications for each x 353are big blocks, allowing Karatsuba and higher algorithms to be used. 354But the cost of calculating the powers b^(n*2^i) must be overcome. 355`SET_STR_PRECOMPUTE_THRESHOLD' usually ends up quite big, around 5000 356digits, and on some processors much bigger still. 357 358 `SET_STR_PRECOMPUTE_THRESHOLD' is based on the input digits (and 359tuned for decimal), though it might be better based on a limb count, so 360as to be independent of the base. But that sort of count isn't used by 361the base case and so would need some sort of initial calculation or 362estimate. 363 364 The main reason `SET_STR_PRECOMPUTE_THRESHOLD' is so much bigger 365than the corresponding `GET_STR_PRECOMPUTE_THRESHOLD' is that 366`mpn_mul_1' is much faster than `mpn_divrem_1' (often by a factor of 5, 367or more). 368 369 370File: gmp.info, Node: Other Algorithms, Next: Assembly Coding, Prev: Radix Conversion Algorithms, Up: Algorithms 371 37216.7 Other Algorithms 373===================== 374 375* Menu: 376 377* Prime Testing Algorithm:: 378* Factorial Algorithm:: 379* Binomial Coefficients Algorithm:: 380* Fibonacci Numbers Algorithm:: 381* Lucas Numbers Algorithm:: 382* Random Number Algorithms:: 383 384 385File: gmp.info, Node: Prime Testing Algorithm, Next: Factorial Algorithm, Prev: Other Algorithms, Up: Other Algorithms 386 38716.7.1 Prime Testing 388-------------------- 389 390The primality testing in `mpz_probab_prime_p' (*note Number Theoretic 391Functions::) first does some trial division by small factors and then 392uses the Miller-Rabin probabilistic primality testing algorithm, as 393described in Knuth section 4.5.4 algorithm P (*note References::). 394 395 For an odd input n, and with n = q*2^k+1 where q is odd, this 396algorithm selects a random base x and tests whether x^q mod n is 1 or 397-1, or an x^(q*2^j) mod n is 1, for 1<=j<=k. If so then n is probably 398prime, if not then n is definitely composite. 399 400 Any prime n will pass the test, but some composites do too. Such 401composites are known as strong pseudoprimes to base x. No n is a 402strong pseudoprime to more than 1/4 of all bases (see Knuth exercise 40322), hence with x chosen at random there's no more than a 1/4 chance a 404"probable prime" will in fact be composite. 405 406 In fact strong pseudoprimes are quite rare, making the test much more 407powerful than this analysis would suggest, but 1/4 is all that's proven 408for an arbitrary n. 409 410 411File: gmp.info, Node: Factorial Algorithm, Next: Binomial Coefficients Algorithm, Prev: Prime Testing Algorithm, Up: Other Algorithms 412 41316.7.2 Factorial 414---------------- 415 416Factorials are calculated by a combination of removal of twos, 417powering, and binary splitting. The procedure can be best illustrated 418with an example, 419 420 23! = 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23 421 422has factors of two removed, 423 424 23! = 2^19.1.1.3.1.5.3.7.1.9.5.11.3.13.7.15.1.17.9.19.5.21.11.23 425 426and the resulting terms collected up according to their multiplicity, 427 428 23! = 2^19.(3.5)^3.(7.9.11)^2.(13.15.17.19.21.23) 429 430 Each sequence such as 13.15.17.19.21.23 is evaluated by splitting 431into every second term, as for instance (13.17.21).(15.19.23), and the 432same recursively on each half. This is implemented iteratively using 433some bit twiddling. 434 435 Such splitting is more efficient than repeated Nx1 multiplies since 436it forms big multiplies, allowing Karatsuba and higher algorithms to be 437used. And even below the Karatsuba threshold a big block of work can 438be more efficient for the basecase algorithm. 439 440 Splitting into subsequences of every second term keeps the resulting 441products more nearly equal in size than would the simpler approach of 442say taking the first half and second half of the sequence. Nearly 443equal products are more efficient for the current multiply 444implementation. 445 446 447File: gmp.info, Node: Binomial Coefficients Algorithm, Next: Fibonacci Numbers Algorithm, Prev: Factorial Algorithm, Up: Other Algorithms 448 44916.7.3 Binomial Coefficients 450---------------------------- 451 452Binomial coefficients C(n,k) are calculated by first arranging k <= n/2 453using C(n,k) = C(n,n-k) if necessary, and then evaluating the following 454product simply from i=2 to i=k. 455 456 k (n-k+i) 457 C(n,k) = (n-k+1) * prod ------- 458 i=2 i 459 460 It's easy to show that each denominator i will divide the product so 461far, so the exact division algorithm is used (*note Exact Division::). 462 463 The numerators n-k+i and denominators i are first accumulated into 464as many fit a limb, to save multi-precision operations, though for 465`mpz_bin_ui' this applies only to the divisors, since n is an `mpz_t' 466and n-k+i in general won't fit in a limb at all. 467 468 469File: gmp.info, Node: Fibonacci Numbers Algorithm, Next: Lucas Numbers Algorithm, Prev: Binomial Coefficients Algorithm, Up: Other Algorithms 470 47116.7.4 Fibonacci Numbers 472------------------------ 473 474The Fibonacci functions `mpz_fib_ui' and `mpz_fib2_ui' are designed for 475calculating isolated F[n] or F[n],F[n-1] values efficiently. 476 477 For small n, a table of single limb values in `__gmp_fib_table' is 478used. On a 32-bit limb this goes up to F[47], or on a 64-bit limb up 479to F[93]. For convenience the table starts at F[-1]. 480 481 Beyond the table, values are generated with a binary powering 482algorithm, calculating a pair F[n] and F[n-1] working from high to low 483across the bits of n. The formulas used are 484 485 F[2k+1] = 4*F[k]^2 - F[k-1]^2 + 2*(-1)^k 486 F[2k-1] = F[k]^2 + F[k-1]^2 487 488 F[2k] = F[2k+1] - F[2k-1] 489 490 At each step, k is the high b bits of n. If the next bit of n is 0 491then F[2k],F[2k-1] is used, or if it's a 1 then F[2k+1],F[2k] is used, 492and the process repeated until all bits of n are incorporated. Notice 493these formulas require just two squares per bit of n. 494 495 It'd be possible to handle the first few n above the single limb 496table with simple additions, using the defining Fibonacci recurrence 497F[k+1]=F[k]+F[k-1], but this is not done since it usually turns out to 498be faster for only about 10 or 20 values of n, and including a block of 499code for just those doesn't seem worthwhile. If they really mattered 500it'd be better to extend the data table. 501 502 Using a table avoids lots of calculations on small numbers, and 503makes small n go fast. A bigger table would make more small n go fast, 504it's just a question of balancing size against desired speed. For GMP 505the code is kept compact, with the emphasis primarily on a good 506powering algorithm. 507 508 `mpz_fib2_ui' returns both F[n] and F[n-1], but `mpz_fib_ui' is only 509interested in F[n]. In this case the last step of the algorithm can 510become one multiply instead of two squares. One of the following two 511formulas is used, according as n is odd or even. 512 513 F[2k] = F[k]*(F[k]+2F[k-1]) 514 515 F[2k+1] = (2F[k]+F[k-1])*(2F[k]-F[k-1]) + 2*(-1)^k 516 517 F[2k+1] here is the same as above, just rearranged to be a multiply. 518For interest, the 2*(-1)^k term both here and above can be applied 519just to the low limb of the calculation, without a carry or borrow into 520further limbs, which saves some code size. See comments with 521`mpz_fib_ui' and the internal `mpn_fib2_ui' for how this is done. 522 523 524File: gmp.info, Node: Lucas Numbers Algorithm, Next: Random Number Algorithms, Prev: Fibonacci Numbers Algorithm, Up: Other Algorithms 525 52616.7.5 Lucas Numbers 527-------------------- 528 529`mpz_lucnum2_ui' derives a pair of Lucas numbers from a pair of 530Fibonacci numbers with the following simple formulas. 531 532 L[k] = F[k] + 2*F[k-1] 533 L[k-1] = 2*F[k] - F[k-1] 534 535 `mpz_lucnum_ui' is only interested in L[n], and some work can be 536saved. Trailing zero bits on n can be handled with a single square 537each. 538 539 L[2k] = L[k]^2 - 2*(-1)^k 540 541 And the lowest 1 bit can be handled with one multiply of a pair of 542Fibonacci numbers, similar to what `mpz_fib_ui' does. 543 544 L[2k+1] = 5*F[k-1]*(2*F[k]+F[k-1]) - 4*(-1)^k 545 546 547File: gmp.info, Node: Random Number Algorithms, Prev: Lucas Numbers Algorithm, Up: Other Algorithms 548 54916.7.6 Random Numbers 550--------------------- 551 552For the `urandomb' functions, random numbers are generated simply by 553concatenating bits produced by the generator. As long as the generator 554has good randomness properties this will produce well-distributed N bit 555numbers. 556 557 For the `urandomm' functions, random numbers in a range 0<=R<N are 558generated by taking values R of ceil(log2(N)) bits each until one 559satisfies R<N. This will normally require only one or two attempts, 560but the attempts are limited in case the generator is somehow 561degenerate and produces only 1 bits or similar. 562 563 The Mersenne Twister generator is by Matsumoto and Nishimura (*note 564References::). It has a non-repeating period of 2^19937-1, which is a 565Mersenne prime, hence the name of the generator. The state is 624 566words of 32-bits each, which is iterated with one XOR and shift for each 56732-bit word generated, making the algorithm very fast. Randomness 568properties are also very good and this is the default algorithm used by 569GMP. 570 571 Linear congruential generators are described in many text books, for 572instance Knuth volume 2 (*note References::). With a modulus M and 573parameters A and C, a integer state S is iterated by the formula S <- 574A*S+C mod M. At each step the new state is a linear function of the 575previous, mod M, hence the name of the generator. 576 577 In GMP only moduli of the form 2^N are supported, and the current 578implementation is not as well optimized as it could be. Overheads are 579significant when N is small, and when N is large clearly the multiply 580at each step will become slow. This is not a big concern, since the 581Mersenne Twister generator is better in every respect and is therefore 582recommended for all normal applications. 583 584 For both generators the current state can be deduced by observing 585enough output and applying some linear algebra (over GF(2) in the case 586of the Mersenne Twister). This generally means raw output is 587unsuitable for cryptographic applications without further hashing or 588the like. 589 590 591File: gmp.info, Node: Assembly Coding, Prev: Other Algorithms, Up: Algorithms 592 59316.8 Assembly Coding 594==================== 595 596The assembly subroutines in GMP are the most significant source of 597speed at small to moderate sizes. At larger sizes algorithm selection 598becomes more important, but of course speedups in low level routines 599will still speed up everything proportionally. 600 601 Carry handling and widening multiplies that are important for GMP 602can't be easily expressed in C. GCC `asm' blocks help a lot and are 603provided in `longlong.h', but hand coding low level routines invariably 604offers a speedup over generic C by a factor of anything from 2 to 10. 605 606* Menu: 607 608* Assembly Code Organisation:: 609* Assembly Basics:: 610* Assembly Carry Propagation:: 611* Assembly Cache Handling:: 612* Assembly Functional Units:: 613* Assembly Floating Point:: 614* Assembly SIMD Instructions:: 615* Assembly Software Pipelining:: 616* Assembly Loop Unrolling:: 617* Assembly Writing Guide:: 618 619 620File: gmp.info, Node: Assembly Code Organisation, Next: Assembly Basics, Prev: Assembly Coding, Up: Assembly Coding 621 62216.8.1 Code Organisation 623------------------------ 624 625The various `mpn' subdirectories contain machine-dependent code, written 626in C or assembly. The `mpn/generic' subdirectory contains default code, 627used when there's no machine-specific version of a particular file. 628 629 Each `mpn' subdirectory is for an ISA family. Generally 32-bit and 63064-bit variants in a family cannot share code and have separate 631directories. Within a family further subdirectories may exist for CPU 632variants. 633 634 In each directory a `nails' subdirectory may exist, holding code with 635nails support for that CPU variant. A `NAILS_SUPPORT' directive in each 636file indicates the nails values the code handles. Nails code only 637exists where it's faster, or promises to be faster, than plain code. 638There's no effort put into nails if they're not going to enhance a 639given CPU. 640 641 642File: gmp.info, Node: Assembly Basics, Next: Assembly Carry Propagation, Prev: Assembly Code Organisation, Up: Assembly Coding 643 64416.8.2 Assembly Basics 645---------------------- 646 647`mpn_addmul_1' and `mpn_submul_1' are the most important routines for 648overall GMP performance. All multiplications and divisions come down to 649repeated calls to these. `mpn_add_n', `mpn_sub_n', `mpn_lshift' and 650`mpn_rshift' are next most important. 651 652 On some CPUs assembly versions of the internal functions 653`mpn_mul_basecase' and `mpn_sqr_basecase' give significant speedups, 654mainly through avoiding function call overheads. They can also 655potentially make better use of a wide superscalar processor, as can 656bigger primitives like `mpn_addmul_2' or `mpn_addmul_4'. 657 658 The restrictions on overlaps between sources and destinations (*note 659Low-level Functions::) are designed to facilitate a variety of 660implementations. For example, knowing `mpn_add_n' won't have partly 661overlapping sources and destination means reading can be done far ahead 662of writing on superscalar processors, and loops can be vectorized on a 663vector processor, depending on the carry handling. 664 665 666File: gmp.info, Node: Assembly Carry Propagation, Next: Assembly Cache Handling, Prev: Assembly Basics, Up: Assembly Coding 667 66816.8.3 Carry Propagation 669------------------------ 670 671The problem that presents most challenges in GMP is propagating carries 672from one limb to the next. In functions like `mpn_addmul_1' and 673`mpn_add_n', carries are the only dependencies between limb operations. 674 675 On processors with carry flags, a straightforward CISC style `adc' is 676generally best. AMD K6 `mpn_addmul_1' however is an example of an 677unusual set of circumstances where a branch works out better. 678 679 On RISC processors generally an add and compare for overflow is 680used. This sort of thing can be seen in `mpn/generic/aors_n.c'. Some 681carry propagation schemes require 4 instructions, meaning at least 4 682cycles per limb, but other schemes may use just 1 or 2. On wide 683superscalar processors performance may be completely determined by the 684number of dependent instructions between carry-in and carry-out for 685each limb. 686 687 On vector processors good use can be made of the fact that a carry 688bit only very rarely propagates more than one limb. When adding a 689single bit to a limb, there's only a carry out if that limb was 690`0xFF...FF' which on random data will be only 1 in 2^mp_bits_per_limb. 691`mpn/cray/add_n.c' is an example of this, it adds all limbs in 692parallel, adds one set of carry bits in parallel and then only rarely 693needs to fall through to a loop propagating further carries. 694 695 On the x86s, GCC (as of version 2.95.2) doesn't generate 696particularly good code for the RISC style idioms that are necessary to 697handle carry bits in C. Often conditional jumps are generated where 698`adc' or `sbb' forms would be better. And so unfortunately almost any 699loop involving carry bits needs to be coded in assembly for best 700results. 701 702 703File: gmp.info, Node: Assembly Cache Handling, Next: Assembly Functional Units, Prev: Assembly Carry Propagation, Up: Assembly Coding 704 70516.8.4 Cache Handling 706--------------------- 707 708GMP aims to perform well both on operands that fit entirely in L1 cache 709and those which don't. 710 711 Basic routines like `mpn_add_n' or `mpn_lshift' are often used on 712large operands, so L2 and main memory performance is important for them. 713`mpn_mul_1' and `mpn_addmul_1' are mostly used for multiply and square 714basecases, so L1 performance matters most for them, unless assembly 715versions of `mpn_mul_basecase' and `mpn_sqr_basecase' exist, in which 716case the remaining uses are mostly for larger operands. 717 718 For L2 or main memory operands, memory access times will almost 719certainly be more than the calculation time. The aim therefore is to 720maximize memory throughput, by starting a load of the next cache line 721while processing the contents of the previous one. Clearly this is 722only possible if the chip has a lock-up free cache or some sort of 723prefetch instruction. Most current chips have both these features. 724 725 Prefetching sources combines well with loop unrolling, since a 726prefetch can be initiated once per unrolled loop (or more than once if 727the loop covers more than one cache line). 728 729 On CPUs without write-allocate caches, prefetching destinations will 730ensure individual stores don't go further down the cache hierarchy, 731limiting bandwidth. Of course for calculations which are slow anyway, 732like `mpn_divrem_1', write-throughs might be fine. 733 734 The distance ahead to prefetch will be determined by memory latency 735versus throughput. The aim of course is to have data arriving 736continuously, at peak throughput. Some CPUs have limits on the number 737of fetches or prefetches in progress. 738 739 If a special prefetch instruction doesn't exist then a plain load 740can be used, but in that case care must be taken not to attempt to read 741past the end of an operand, since that might produce a segmentation 742violation. 743 744 Some CPUs or systems have hardware that detects sequential memory 745accesses and initiates suitable cache movements automatically, making 746life easy. 747 748 749File: gmp.info, Node: Assembly Functional Units, Next: Assembly Floating Point, Prev: Assembly Cache Handling, Up: Assembly Coding 750 75116.8.5 Functional Units 752----------------------- 753 754When choosing an approach for an assembly loop, consideration is given 755to what operations can execute simultaneously and what throughput can 756thereby be achieved. In some cases an algorithm can be tweaked to 757accommodate available resources. 758 759 Loop control will generally require a counter and pointer updates, 760costing as much as 5 instructions, plus any delays a branch introduces. 761CPU addressing modes might reduce pointer updates, perhaps by allowing 762just one updating pointer and others expressed as offsets from it, or 763on CISC chips with all addressing done with the loop counter as a 764scaled index. 765 766 The final loop control cost can be amortised by processing several 767limbs in each iteration (*note Assembly Loop Unrolling::). This at 768least ensures loop control isn't a big fraction the work done. 769 770 Memory throughput is always a limit. If perhaps only one load or 771one store can be done per cycle then 3 cycles/limb will the top speed 772for "binary" operations like `mpn_add_n', and any code achieving that 773is optimal. 774 775 Integer resources can be freed up by having the loop counter in a 776float register, or by pressing the float units into use for some 777multiplying, perhaps doing every second limb on the float side (*note 778Assembly Floating Point::). 779 780 Float resources can be freed up by doing carry propagation on the 781integer side, or even by doing integer to float conversions in integers 782using bit twiddling. 783 784 785File: gmp.info, Node: Assembly Floating Point, Next: Assembly SIMD Instructions, Prev: Assembly Functional Units, Up: Assembly Coding 786 78716.8.6 Floating Point 788--------------------- 789 790Floating point arithmetic is used in GMP for multiplications on CPUs 791with poor integer multipliers. It's mostly useful for `mpn_mul_1', 792`mpn_addmul_1' and `mpn_submul_1' on 64-bit machines, and 793`mpn_mul_basecase' on both 32-bit and 64-bit machines. 794 795 With IEEE 53-bit double precision floats, integer multiplications 796producing up to 53 bits will give exact results. Breaking a 64x64 797multiplication into eight 16x32->48 bit pieces is convenient. With 798some care though six 21x32->53 bit products can be used, if one of the 799lower two 21-bit pieces also uses the sign bit. 800 801 For the `mpn_mul_1' family of functions on a 64-bit machine, the 802invariant single limb is split at the start, into 3 or 4 pieces. 803Inside the loop, the bignum operand is split into 32-bit pieces. Fast 804conversion of these unsigned 32-bit pieces to floating point is highly 805machine-dependent. In some cases, reading the data into the integer 806unit, zero-extending to 64-bits, then transferring to the floating 807point unit back via memory is the only option. 808 809 Converting partial products back to 64-bit limbs is usually best 810done as a signed conversion. Since all values are smaller than 2^53, 811signed and unsigned are the same, but most processors lack unsigned 812conversions. 813 814 815 816 Here is a diagram showing 16x32 bit products for an `mpn_mul_1' or 817`mpn_addmul_1' with a 64-bit limb. The single limb operand V is split 818into four 16-bit parts. The multi-limb operand U is split in the loop 819into two 32-bit parts. 820 821 +---+---+---+---+ 822 |v48|v32|v16|v00| V operand 823 +---+---+---+---+ 824 825 +-------+---+---+ 826 x | u32 | u00 | U operand (one limb) 827 +---------------+ 828 829 --------------------------------- 830 831 +-----------+ 832 | u00 x v00 | p00 48-bit products 833 +-----------+ 834 +-----------+ 835 | u00 x v16 | p16 836 +-----------+ 837 +-----------+ 838 | u00 x v32 | p32 839 +-----------+ 840 +-----------+ 841 | u00 x v48 | p48 842 +-----------+ 843 +-----------+ 844 | u32 x v00 | r32 845 +-----------+ 846 +-----------+ 847 | u32 x v16 | r48 848 +-----------+ 849 +-----------+ 850 | u32 x v32 | r64 851 +-----------+ 852 +-----------+ 853 | u32 x v48 | r80 854 +-----------+ 855 856 p32 and r32 can be summed using floating-point addition, and 857likewise p48 and r48. p00 and p16 can be summed with r64 and r80 from 858the previous iteration. 859 860 For each loop then, four 49-bit quantities are transferred to the 861integer unit, aligned as follows, 862 863 |-----64bits----|-----64bits----| 864 +------------+ 865 | p00 + r64' | i00 866 +------------+ 867 +------------+ 868 | p16 + r80' | i16 869 +------------+ 870 +------------+ 871 | p32 + r32 | i32 872 +------------+ 873 +------------+ 874 | p48 + r48 | i48 875 +------------+ 876 877 The challenge then is to sum these efficiently and add in a carry 878limb, generating a low 64-bit result limb and a high 33-bit carry limb 879(i48 extends 33 bits into the high half). 880 881 882File: gmp.info, Node: Assembly SIMD Instructions, Next: Assembly Software Pipelining, Prev: Assembly Floating Point, Up: Assembly Coding 883 88416.8.7 SIMD Instructions 885------------------------ 886 887The single-instruction multiple-data support in current microprocessors 888is aimed at signal processing algorithms where each data point can be 889treated more or less independently. There's generally not much support 890for propagating the sort of carries that arise in GMP. 891 892 SIMD multiplications of say four 16x16 bit multiplies only do as much 893work as one 32x32 from GMP's point of view, and need some shifts and 894adds besides. But of course if say the SIMD form is fully pipelined 895and uses less instruction decoding then it may still be worthwhile. 896 897 On the x86 chips, MMX has so far found a use in `mpn_rshift' and 898`mpn_lshift', and is used in a special case for 16-bit multipliers in 899the P55 `mpn_mul_1'. SSE2 is used for Pentium 4 `mpn_mul_1', 900`mpn_addmul_1', and `mpn_submul_1'. 901 902 903File: gmp.info, Node: Assembly Software Pipelining, Next: Assembly Loop Unrolling, Prev: Assembly SIMD Instructions, Up: Assembly Coding 904 90516.8.8 Software Pipelining 906-------------------------- 907 908Software pipelining consists of scheduling instructions around the 909branch point in a loop. For example a loop might issue a load not for 910use in the present iteration but the next, thereby allowing extra 911cycles for the data to arrive from memory. 912 913 Naturally this is wanted only when doing things like loads or 914multiplies that take several cycles to complete, and only where a CPU 915has multiple functional units so that other work can be done in the 916meantime. 917 918 A pipeline with several stages will have a data value in progress at 919each stage and each loop iteration moves them along one stage. This is 920like juggling. 921 922 If the latency of some instruction is greater than the loop time 923then it will be necessary to unroll, so one register has a result ready 924to use while another (or multiple others) are still in progress. 925(*note Assembly Loop Unrolling::). 926 927 928File: gmp.info, Node: Assembly Loop Unrolling, Next: Assembly Writing Guide, Prev: Assembly Software Pipelining, Up: Assembly Coding 929 93016.8.9 Loop Unrolling 931--------------------- 932 933Loop unrolling consists of replicating code so that several limbs are 934processed in each loop. At a minimum this reduces loop overheads by a 935corresponding factor, but it can also allow better register usage, for 936example alternately using one register combination and then another. 937Judicious use of `m4' macros can help avoid lots of duplication in the 938source code. 939 940 Any amount of unrolling can be handled with a loop counter that's 941decremented by N each time, stopping when the remaining count is less 942than the further N the loop will process. Or by subtracting N at the 943start, the termination condition becomes when the counter C is less 944than 0 (and the count of remaining limbs is C+N). 945 946 Alternately for a power of 2 unroll the loop count and remainder can 947be established with a shift and mask. This is convenient if also 948making a computed jump into the middle of a large loop. 949 950 The limbs not a multiple of the unrolling can be handled in various 951ways, for example 952 953 * A simple loop at the end (or the start) to process the excess. 954 Care will be wanted that it isn't too much slower than the 955 unrolled part. 956 957 * A set of binary tests, for example after an 8-limb unrolling, test 958 for 4 more limbs to process, then a further 2 more or not, and 959 finally 1 more or not. This will probably take more code space 960 than a simple loop. 961 962 * A `switch' statement, providing separate code for each possible 963 excess, for example an 8-limb unrolling would have separate code 964 for 0 remaining, 1 remaining, etc, up to 7 remaining. This might 965 take a lot of code, but may be the best way to optimize all cases 966 in combination with a deep pipelined loop. 967 968 * A computed jump into the middle of the loop, thus making the first 969 iteration handle the excess. This should make times smoothly 970 increase with size, which is attractive, but setups for the jump 971 and adjustments for pointers can be tricky and could become quite 972 difficult in combination with deep pipelining. 973 974 975File: gmp.info, Node: Assembly Writing Guide, Prev: Assembly Loop Unrolling, Up: Assembly Coding 976 97716.8.10 Writing Guide 978--------------------- 979 980This is a guide to writing software pipelined loops for processing limb 981vectors in assembly. 982 983 First determine the algorithm and which instructions are needed. 984Code it without unrolling or scheduling, to make sure it works. On a 9853-operand CPU try to write each new value to a new register, this will 986greatly simplify later steps. 987 988 Then note for each instruction the functional unit and/or issue port 989requirements. If an instruction can use either of two units, like U0 990or U1 then make a category "U0/U1". Count the total using each unit 991(or combined unit), and count all instructions. 992 993 Figure out from those counts the best possible loop time. The goal 994will be to find a perfect schedule where instruction latencies are 995completely hidden. The total instruction count might be the limiting 996factor, or perhaps a particular functional unit. It might be possible 997to tweak the instructions to help the limiting factor. 998 999 Suppose the loop time is N, then make N issue buckets, with the 1000final loop branch at the end of the last. Now fill the buckets with 1001dummy instructions using the functional units desired. Run this to 1002make sure the intended speed is reached. 1003 1004 Now replace the dummy instructions with the real instructions from 1005the slow but correct loop you started with. The first will typically 1006be a load instruction. Then the instruction using that value is placed 1007in a bucket an appropriate distance down. Run the loop again, to check 1008it still runs at target speed. 1009 1010 Keep placing instructions, frequently measuring the loop. After a 1011few you will need to wrap around from the last bucket back to the top 1012of the loop. If you used the new-register for new-value strategy above 1013then there will be no register conflicts. If not then take care not to 1014clobber something already in use. Changing registers at this time is 1015very error prone. 1016 1017 The loop will overlap two or more of the original loop iterations, 1018and the computation of one vector element result will be started in one 1019iteration of the new loop, and completed one or several iterations 1020later. 1021 1022 The final step is to create feed-in and wind-down code for the loop. 1023A good way to do this is to make a copy (or copies) of the loop at the 1024start and delete those instructions which don't have valid antecedents, 1025and at the end replicate and delete those whose results are unwanted 1026(including any further loads). 1027 1028 The loop will have a minimum number of limbs loaded and processed, 1029so the feed-in code must test if the request size is smaller and skip 1030either to a suitable part of the wind-down or to special code for small 1031sizes. 1032 1033 1034File: gmp.info, Node: Internals, Next: Contributors, Prev: Algorithms, Up: Top 1035 103617 Internals 1037************ 1038 1039*This chapter is provided only for informational purposes and the 1040various internals described here may change in future GMP releases. 1041Applications expecting to be compatible with future releases should use 1042only the documented interfaces described in previous chapters.* 1043 1044* Menu: 1045 1046* Integer Internals:: 1047* Rational Internals:: 1048* Float Internals:: 1049* Raw Output Internals:: 1050* C++ Interface Internals:: 1051 1052 1053File: gmp.info, Node: Integer Internals, Next: Rational Internals, Prev: Internals, Up: Internals 1054 105517.1 Integer Internals 1056====================== 1057 1058`mpz_t' variables represent integers using sign and magnitude, in space 1059dynamically allocated and reallocated. The fields are as follows. 1060 1061`_mp_size' 1062 The number of limbs, or the negative of that when representing a 1063 negative integer. Zero is represented by `_mp_size' set to zero, 1064 in which case the `_mp_d' data is unused. 1065 1066`_mp_d' 1067 A pointer to an array of limbs which is the magnitude. These are 1068 stored "little endian" as per the `mpn' functions, so `_mp_d[0]' 1069 is the least significant limb and `_mp_d[ABS(_mp_size)-1]' is the 1070 most significant. Whenever `_mp_size' is non-zero, the most 1071 significant limb is non-zero. 1072 1073 Currently there's always at least one limb allocated, so for 1074 instance `mpz_set_ui' never needs to reallocate, and `mpz_get_ui' 1075 can fetch `_mp_d[0]' unconditionally (though its value is then 1076 only wanted if `_mp_size' is non-zero). 1077 1078`_mp_alloc' 1079 `_mp_alloc' is the number of limbs currently allocated at `_mp_d', 1080 and naturally `_mp_alloc >= ABS(_mp_size)'. When an `mpz' routine 1081 is about to (or might be about to) increase `_mp_size', it checks 1082 `_mp_alloc' to see whether there's enough space, and reallocates 1083 if not. `MPZ_REALLOC' is generally used for this. 1084 1085 The various bitwise logical functions like `mpz_and' behave as if 1086negative values were twos complement. But sign and magnitude is always 1087used internally, and necessary adjustments are made during the 1088calculations. Sometimes this isn't pretty, but sign and magnitude are 1089best for other routines. 1090 1091 Some internal temporary variables are setup with `MPZ_TMP_INIT' and 1092these have `_mp_d' space obtained from `TMP_ALLOC' rather than the 1093memory allocation functions. Care is taken to ensure that these are 1094big enough that no reallocation is necessary (since it would have 1095unpredictable consequences). 1096 1097 `_mp_size' and `_mp_alloc' are `int', although `mp_size_t' is 1098usually a `long'. This is done to make the fields just 32 bits on some 109964 bits systems, thereby saving a few bytes of data space but still 1100providing plenty of range. 1101 1102 1103File: gmp.info, Node: Rational Internals, Next: Float Internals, Prev: Integer Internals, Up: Internals 1104 110517.2 Rational Internals 1106======================= 1107 1108`mpq_t' variables represent rationals using an `mpz_t' numerator and 1109denominator (*note Integer Internals::). 1110 1111 The canonical form adopted is denominator positive (and non-zero), 1112no common factors between numerator and denominator, and zero uniquely 1113represented as 0/1. 1114 1115 It's believed that casting out common factors at each stage of a 1116calculation is best in general. A GCD is an O(N^2) operation so it's 1117better to do a few small ones immediately than to delay and have to do 1118a big one later. Knowing the numerator and denominator have no common 1119factors can be used for example in `mpq_mul' to make only two cross 1120GCDs necessary, not four. 1121 1122 This general approach to common factors is badly sub-optimal in the 1123presence of simple factorizations or little prospect for cancellation, 1124but GMP has no way to know when this will occur. As per *Note 1125Efficiency::, that's left to applications. The `mpq_t' framework might 1126still suit, with `mpq_numref' and `mpq_denref' for direct access to the 1127numerator and denominator, or of course `mpz_t' variables can be used 1128directly. 1129 1130 1131File: gmp.info, Node: Float Internals, Next: Raw Output Internals, Prev: Rational Internals, Up: Internals 1132 113317.3 Float Internals 1134==================== 1135 1136Efficient calculation is the primary aim of GMP floats and the use of 1137whole limbs and simple rounding facilitates this. 1138 1139 `mpf_t' floats have a variable precision mantissa and a single 1140machine word signed exponent. The mantissa is represented using sign 1141and magnitude. 1142 1143 most least 1144 significant significant 1145 limb limb 1146 1147 _mp_d 1148 |---- _mp_exp ---> | 1149 _____ _____ _____ _____ _____ 1150 |_____|_____|_____|_____|_____| 1151 . <------------ radix point 1152 1153 <-------- _mp_size ---------> 1154 1155The fields are as follows. 1156 1157`_mp_size' 1158 The number of limbs currently in use, or the negative of that when 1159 representing a negative value. Zero is represented by `_mp_size' 1160 and `_mp_exp' both set to zero, and in that case the `_mp_d' data 1161 is unused. (In the future `_mp_exp' might be undefined when 1162 representing zero.) 1163 1164`_mp_prec' 1165 The precision of the mantissa, in limbs. In any calculation the 1166 aim is to produce `_mp_prec' limbs of result (the most significant 1167 being non-zero). 1168 1169`_mp_d' 1170 A pointer to the array of limbs which is the absolute value of the 1171 mantissa. These are stored "little endian" as per the `mpn' 1172 functions, so `_mp_d[0]' is the least significant limb and 1173 `_mp_d[ABS(_mp_size)-1]' the most significant. 1174 1175 The most significant limb is always non-zero, but there are no 1176 other restrictions on its value, in particular the highest 1 bit 1177 can be anywhere within the limb. 1178 1179 `_mp_prec+1' limbs are allocated to `_mp_d', the extra limb being 1180 for convenience (see below). There are no reallocations during a 1181 calculation, only in a change of precision with `mpf_set_prec'. 1182 1183`_mp_exp' 1184 The exponent, in limbs, determining the location of the implied 1185 radix point. Zero means the radix point is just above the most 1186 significant limb. Positive values mean a radix point offset 1187 towards the lower limbs and hence a value >= 1, as for example in 1188 the diagram above. Negative exponents mean a radix point further 1189 above the highest limb. 1190 1191 Naturally the exponent can be any value, it doesn't have to fall 1192 within the limbs as the diagram shows, it can be a long way above 1193 or a long way below. Limbs other than those included in the 1194 `{_mp_d,_mp_size}' data are treated as zero. 1195 1196 The `_mp_size' and `_mp_prec' fields are `int', although the 1197`mp_size_t' type is usually a `long'. The `_mp_exp' field is usually 1198`long'. This is done to make some fields just 32 bits on some 64 bits 1199systems, thereby saving a few bytes of data space but still providing 1200plenty of precision and a very large range. 1201 1202 1203The following various points should be noted. 1204 1205Low Zeros 1206 The least significant limbs `_mp_d[0]' etc can be zero, though 1207 such low zeros can always be ignored. Routines likely to produce 1208 low zeros check and avoid them to save time in subsequent 1209 calculations, but for most routines they're quite unlikely and 1210 aren't checked. 1211 1212Mantissa Size Range 1213 The `_mp_size' count of limbs in use can be less than `_mp_prec' if 1214 the value can be represented in less. This means low precision 1215 values or small integers stored in a high precision `mpf_t' can 1216 still be operated on efficiently. 1217 1218 `_mp_size' can also be greater than `_mp_prec'. Firstly a value is 1219 allowed to use all of the `_mp_prec+1' limbs available at `_mp_d', 1220 and secondly when `mpf_set_prec_raw' lowers `_mp_prec' it leaves 1221 `_mp_size' unchanged and so the size can be arbitrarily bigger than 1222 `_mp_prec'. 1223 1224Rounding 1225 All rounding is done on limb boundaries. Calculating `_mp_prec' 1226 limbs with the high non-zero will ensure the application requested 1227 minimum precision is obtained. 1228 1229 The use of simple "trunc" rounding towards zero is efficient, 1230 since there's no need to examine extra limbs and increment or 1231 decrement. 1232 1233Bit Shifts 1234 Since the exponent is in limbs, there are no bit shifts in basic 1235 operations like `mpf_add' and `mpf_mul'. When differing exponents 1236 are encountered all that's needed is to adjust pointers to line up 1237 the relevant limbs. 1238 1239 Of course `mpf_mul_2exp' and `mpf_div_2exp' will require bit 1240 shifts, but the choice is between an exponent in limbs which 1241 requires shifts there, or one in bits which requires them almost 1242 everywhere else. 1243 1244Use of `_mp_prec+1' Limbs 1245 The extra limb on `_mp_d' (`_mp_prec+1' rather than just 1246 `_mp_prec') helps when an `mpf' routine might get a carry from its 1247 operation. `mpf_add' for instance will do an `mpn_add' of 1248 `_mp_prec' limbs. If there's no carry then that's the result, but 1249 if there is a carry then it's stored in the extra limb of space and 1250 `_mp_size' becomes `_mp_prec+1'. 1251 1252 Whenever `_mp_prec+1' limbs are held in a variable, the low limb 1253 is not needed for the intended precision, only the `_mp_prec' high 1254 limbs. But zeroing it out or moving the rest down is unnecessary. 1255 Subsequent routines reading the value will simply take the high 1256 limbs they need, and this will be `_mp_prec' if their target has 1257 that same precision. This is no more than a pointer adjustment, 1258 and must be checked anyway since the destination precision can be 1259 different from the sources. 1260 1261 Copy functions like `mpf_set' will retain a full `_mp_prec+1' limbs 1262 if available. This ensures that a variable which has `_mp_size' 1263 equal to `_mp_prec+1' will get its full exact value copied. 1264 Strictly speaking this is unnecessary since only `_mp_prec' limbs 1265 are needed for the application's requested precision, but it's 1266 considered that an `mpf_set' from one variable into another of the 1267 same precision ought to produce an exact copy. 1268 1269Application Precisions 1270 `__GMPF_BITS_TO_PREC' converts an application requested precision 1271 to an `_mp_prec'. The value in bits is rounded up to a whole limb 1272 then an extra limb is added since the most significant limb of 1273 `_mp_d' is only non-zero and therefore might contain only one bit. 1274 1275 `__GMPF_PREC_TO_BITS' does the reverse conversion, and removes the 1276 extra limb from `_mp_prec' before converting to bits. The net 1277 effect of reading back with `mpf_get_prec' is simply the precision 1278 rounded up to a multiple of `mp_bits_per_limb'. 1279 1280 Note that the extra limb added here for the high only being 1281 non-zero is in addition to the extra limb allocated to `_mp_d'. 1282 For example with a 32-bit limb, an application request for 250 1283 bits will be rounded up to 8 limbs, then an extra added for the 1284 high being only non-zero, giving an `_mp_prec' of 9. `_mp_d' then 1285 gets 10 limbs allocated. Reading back with `mpf_get_prec' will 1286 take `_mp_prec' subtract 1 limb and multiply by 32, giving 256 1287 bits. 1288 1289 Strictly speaking, the fact the high limb has at least one bit 1290 means that a float with, say, 3 limbs of 32-bits each will be 1291 holding at least 65 bits, but for the purposes of `mpf_t' it's 1292 considered simply to be 64 bits, a nice multiple of the limb size. 1293 1294 1295File: gmp.info, Node: Raw Output Internals, Next: C++ Interface Internals, Prev: Float Internals, Up: Internals 1296 129717.4 Raw Output Internals 1298========================= 1299 1300`mpz_out_raw' uses the following format. 1301 1302 +------+------------------------+ 1303 | size | data bytes | 1304 +------+------------------------+ 1305 1306 The size is 4 bytes written most significant byte first, being the 1307number of subsequent data bytes, or the twos complement negative of 1308that when a negative integer is represented. The data bytes are the 1309absolute value of the integer, written most significant byte first. 1310 1311 The most significant data byte is always non-zero, so the output is 1312the same on all systems, irrespective of limb size. 1313 1314 In GMP 1, leading zero bytes were written to pad the data bytes to a 1315multiple of the limb size. `mpz_inp_raw' will still accept this, for 1316compatibility. 1317 1318 The use of "big endian" for both the size and data fields is 1319deliberate, it makes the data easy to read in a hex dump of a file. 1320Unfortunately it also means that the limb data must be reversed when 1321reading or writing, so neither a big endian nor little endian system 1322can just read and write `_mp_d'. 1323 1324 1325File: gmp.info, Node: C++ Interface Internals, Prev: Raw Output Internals, Up: Internals 1326 132717.5 C++ Interface Internals 1328============================ 1329 1330A system of expression templates is used to ensure something like 1331`a=b+c' turns into a simple call to `mpz_add' etc. For `mpf_class' the 1332scheme also ensures the precision of the final destination is used for 1333any temporaries within a statement like `f=w*x+y*z'. These are 1334important features which a naive implementation cannot provide. 1335 1336 A simplified description of the scheme follows. The true scheme is 1337complicated by the fact that expressions have different return types. 1338For detailed information, refer to the source code. 1339 1340 To perform an operation, say, addition, we first define a "function 1341object" evaluating it, 1342 1343 struct __gmp_binary_plus 1344 { 1345 static void eval(mpf_t f, mpf_t g, mpf_t h) { mpf_add(f, g, h); } 1346 }; 1347 1348And an "additive expression" object, 1349 1350 __gmp_expr<__gmp_binary_expr<mpf_class, mpf_class, __gmp_binary_plus> > 1351 operator+(const mpf_class &f, const mpf_class &g) 1352 { 1353 return __gmp_expr 1354 <__gmp_binary_expr<mpf_class, mpf_class, __gmp_binary_plus> >(f, g); 1355 } 1356 1357 The seemingly redundant `__gmp_expr<__gmp_binary_expr<...>>' is used 1358to encapsulate any possible kind of expression into a single template 1359type. In fact even `mpf_class' etc are `typedef' specializations of 1360`__gmp_expr'. 1361 1362 Next we define assignment of `__gmp_expr' to `mpf_class'. 1363 1364 template <class T> 1365 mpf_class & mpf_class::operator=(const __gmp_expr<T> &expr) 1366 { 1367 expr.eval(this->get_mpf_t(), this->precision()); 1368 return *this; 1369 } 1370 1371 template <class Op> 1372 void __gmp_expr<__gmp_binary_expr<mpf_class, mpf_class, Op> >::eval 1373 (mpf_t f, mp_bitcnt_t precision) 1374 { 1375 Op::eval(f, expr.val1.get_mpf_t(), expr.val2.get_mpf_t()); 1376 } 1377 1378 where `expr.val1' and `expr.val2' are references to the expression's 1379operands (here `expr' is the `__gmp_binary_expr' stored within the 1380`__gmp_expr'). 1381 1382 This way, the expression is actually evaluated only at the time of 1383assignment, when the required precision (that of `f') is known. 1384Furthermore the target `mpf_t' is now available, thus we can call 1385`mpf_add' directly with `f' as the output argument. 1386 1387 Compound expressions are handled by defining operators taking 1388subexpressions as their arguments, like this: 1389 1390 template <class T, class U> 1391 __gmp_expr 1392 <__gmp_binary_expr<__gmp_expr<T>, __gmp_expr<U>, __gmp_binary_plus> > 1393 operator+(const __gmp_expr<T> &expr1, const __gmp_expr<U> &expr2) 1394 { 1395 return __gmp_expr 1396 <__gmp_binary_expr<__gmp_expr<T>, __gmp_expr<U>, __gmp_binary_plus> > 1397 (expr1, expr2); 1398 } 1399 1400 And the corresponding specializations of `__gmp_expr::eval': 1401 1402 template <class T, class U, class Op> 1403 void __gmp_expr 1404 <__gmp_binary_expr<__gmp_expr<T>, __gmp_expr<U>, Op> >::eval 1405 (mpf_t f, mp_bitcnt_t precision) 1406 { 1407 // declare two temporaries 1408 mpf_class temp1(expr.val1, precision), temp2(expr.val2, precision); 1409 Op::eval(f, temp1.get_mpf_t(), temp2.get_mpf_t()); 1410 } 1411 1412 The expression is thus recursively evaluated to any level of 1413complexity and all subexpressions are evaluated to the precision of `f'. 1414 1415 1416File: gmp.info, Node: Contributors, Next: References, Prev: Internals, Up: Top 1417 1418Appendix A Contributors 1419*********************** 1420 1421Torbjo"rn Granlund wrote the original GMP library and is still the main 1422developer. Code not explicitly attributed to others, was contributed by 1423Torbjo"rn. Several other individuals and organizations have contributed 1424GMP. Here is a list in chronological order on first contribution: 1425 1426 Gunnar Sjo"din and Hans Riesel helped with mathematical problems in 1427early versions of the library. 1428 1429 Richard Stallman helped with the interface design and revised the 1430first version of this manual. 1431 1432 Brian Beuning and Doug Lea helped with testing of early versions of 1433the library and made creative suggestions. 1434 1435 John Amanatides of York University in Canada contributed the function 1436`mpz_probab_prime_p'. 1437 1438 Paul Zimmermann wrote the REDC-based mpz_powm code, the 1439Scho"nhage-Strassen FFT multiply code, and the Karatsuba square root 1440code. He also improved the Toom3 code for GMP 4.2. Paul sparked the 1441development of GMP 2, with his comparisons between bignum packages. 1442The ECMNET project Paul is organizing was a driving force behind many 1443of the optimizations in GMP 3. Paul also wrote the new GMP 4.3 nth 1444root code (with Torbjo"rn). 1445 1446 Ken Weber (Kent State University, Universidade Federal do Rio Grande 1447do Sul) contributed now defunct versions of `mpz_gcd', `mpz_divexact', 1448`mpn_gcd', and `mpn_bdivmod', partially supported by CNPq (Brazil) 1449grant 301314194-2. 1450 1451 Per Bothner of Cygnus Support helped to set up GMP to use Cygnus' 1452configure. He has also made valuable suggestions and tested numerous 1453intermediary releases. 1454 1455 Joachim Hollman was involved in the design of the `mpf' interface, 1456and in the `mpz' design revisions for version 2. 1457 1458 Bennet Yee contributed the initial versions of `mpz_jacobi' and 1459`mpz_legendre'. 1460 1461 Andreas Schwab contributed the files `mpn/m68k/lshift.S' and 1462`mpn/m68k/rshift.S' (now in `.asm' form). 1463 1464 Robert Harley of Inria, France and David Seal of ARM, England, 1465suggested clever improvements for population count. Robert also wrote 1466highly optimized Karatsuba and 3-way Toom multiplication functions for 1467GMP 3, and contributed the ARM assembly code. 1468 1469 Torsten Ekedahl of the Mathematical department of Stockholm 1470University provided significant inspiration during several phases of 1471the GMP development. His mathematical expertise helped improve several 1472algorithms. 1473 1474 Linus Nordberg wrote the new configure system based on autoconf and 1475implemented the new random functions. 1476 1477 Kevin Ryde worked on a large number of things: optimized x86 code, 1478m4 asm macros, parameter tuning, speed measuring, the configure system, 1479function inlining, divisibility tests, bit scanning, Jacobi symbols, 1480Fibonacci and Lucas number functions, printf and scanf functions, perl 1481interface, demo expression parser, the algorithms chapter in the 1482manual, `gmpasm-mode.el', and various miscellaneous improvements 1483elsewhere. 1484 1485 Kent Boortz made the Mac OS 9 port. 1486 1487 Steve Root helped write the optimized alpha 21264 assembly code. 1488 1489 Gerardo Ballabio wrote the `gmpxx.h' C++ class interface and the C++ 1490`istream' input routines. 1491 1492 Jason Moxham rewrote `mpz_fac_ui'. 1493 1494 Pedro Gimeno implemented the Mersenne Twister and made other random 1495number improvements. 1496 1497 Niels Mo"ller wrote the sub-quadratic GCD and extended GCD code, the 1498quadratic Hensel division code, and (with Torbjo"rn) the new divide and 1499conquer division code for GMP 4.3. Niels also helped implement the new 1500Toom multiply code for GMP 4.3 and implemented helper functions to 1501simplify Toom evaluations for GMP 5.0. He wrote the original version 1502of mpn_mulmod_bnm1. 1503 1504 Alberto Zanoni and Marco Bodrato suggested the unbalanced multiply 1505strategy, and found the optimal strategies for evaluation and 1506interpolation in Toom multiplication. 1507 1508 Marco Bodrato helped implement the new Toom multiply code for GMP 15094.3 and implemented most of the new Toom multiply and squaring code for 15105.0. He is the main author of the current mpn_mulmod_bnm1 and 1511mpn_mullo_n. Marco also wrote the functions mpn_invert and 1512mpn_invertappr. 1513 1514 David Harvey suggested the internal function `mpn_bdiv_dbm1', 1515implementing division relevant to Toom multiplication. He also worked 1516on fast assembly sequences, in particular on a fast AMD64 1517`mpn_mul_basecase'. 1518 1519 Martin Boij wrote `mpn_perfect_power_p'. 1520 1521 (This list is chronological, not ordered after significance. If you 1522have contributed to GMP but are not listed above, please tell 1523<gmp-devel@gmplib.org> about the omission!) 1524 1525 The development of floating point functions of GNU MP 2, were 1526supported in part by the ESPRIT-BRA (Basic Research Activities) 6846 1527project POSSO (POlynomial System SOlving). 1528 1529 The development of GMP 2, 3, and 4 was supported in part by the IDA 1530Center for Computing Sciences. 1531 1532 Thanks go to Hans Thorsen for donating an SGI system for the GMP 1533test system environment. 1534 1535 1536File: gmp.info, Node: References, Next: GNU Free Documentation License, Prev: Contributors, Up: Top 1537 1538Appendix B References 1539********************* 1540 1541B.1 Books 1542========= 1543 1544 * Jonathan M. Borwein and Peter B. Borwein, "Pi and the AGM: A Study 1545 in Analytic Number Theory and Computational Complexity", Wiley, 1546 1998. 1547 1548 * Richard Crandall and Carl Pomerance, "Prime Numbers: A 1549 Computational Perspective", 2nd edition, Springer-Verlag, 2005. 1550 `http://math.dartmouth.edu/~carlp/' 1551 1552 * Henri Cohen, "A Course in Computational Algebraic Number Theory", 1553 Graduate Texts in Mathematics number 138, Springer-Verlag, 1993. 1554 `http://www.math.u-bordeaux.fr/~cohen/' 1555 1556 * Donald E. Knuth, "The Art of Computer Programming", volume 2, 1557 "Seminumerical Algorithms", 3rd edition, Addison-Wesley, 1998. 1558 `http://www-cs-faculty.stanford.edu/~knuth/taocp.html' 1559 1560 * John D. Lipson, "Elements of Algebra and Algebraic Computing", The 1561 Benjamin Cummings Publishing Company Inc, 1981. 1562 1563 * Alfred J. Menezes, Paul C. van Oorschot and Scott A. Vanstone, 1564 "Handbook of Applied Cryptography", 1565 `http://www.cacr.math.uwaterloo.ca/hac/' 1566 1567 * Richard M. Stallman and the GCC Developer Community, "Using the 1568 GNU Compiler Collection", Free Software Foundation, 2008, 1569 available online `http://gcc.gnu.org/onlinedocs/', and in the GCC 1570 package `ftp://ftp.gnu.org/gnu/gcc/' 1571 1572B.2 Papers 1573========== 1574 1575 * Yves Bertot, Nicolas Magaud and Paul Zimmermann, "A Proof of GMP 1576 Square Root", Journal of Automated Reasoning, volume 29, 2002, pp. 1577 225-252. Also available online as INRIA Research Report 4475, 1578 June 2001, `http://www.inria.fr/rrrt/rr-4475.html' 1579 1580 * Christoph Burnikel and Joachim Ziegler, "Fast Recursive Division", 1581 Max-Planck-Institut fuer Informatik Research Report MPI-I-98-1-022, 1582 `http://data.mpi-sb.mpg.de/internet/reports.nsf/NumberView/1998-1-022' 1583 1584 * Torbjo"rn Granlund and Peter L. Montgomery, "Division by Invariant 1585 Integers using Multiplication", in Proceedings of the SIGPLAN 1586 PLDI'94 Conference, June 1994. Also available 1587 `ftp://ftp.cwi.nl/pub/pmontgom/divcnst.psa4.gz' (and .psl.gz). 1588 1589 * Niels Mo"ller and Torbjo"rn Granlund, "Improved division by 1590 invariant integers", IEEE Transactions on Computers, 11 June 2010. 1591 `http://gmplib.org/~tege/division-paper.pdf' 1592 1593 * Torbjo"rn Granlund and Niels Mo"ller, "Division of integers large 1594 and small", to appear. 1595 1596 * Tudor Jebelean, "An algorithm for exact division", Journal of 1597 Symbolic Computation, volume 15, 1993, pp. 169-180. Research 1598 report version available 1599 `ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1992/92-35.ps.gz' 1600 1601 * Tudor Jebelean, "Exact Division with Karatsuba Complexity - 1602 Extended Abstract", RISC-Linz technical report 96-31, 1603 `ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1996/96-31.ps.gz' 1604 1605 * Tudor Jebelean, "Practical Integer Division with Karatsuba 1606 Complexity", ISSAC 97, pp. 339-341. Technical report available 1607 `ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1996/96-29.ps.gz' 1608 1609 * Tudor Jebelean, "A Generalization of the Binary GCD Algorithm", 1610 ISSAC 93, pp. 111-116. Technical report version available 1611 `ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1993/93-01.ps.gz' 1612 1613 * Tudor Jebelean, "A Double-Digit Lehmer-Euclid Algorithm for 1614 Finding the GCD of Long Integers", Journal of Symbolic 1615 Computation, volume 19, 1995, pp. 145-157. Technical report 1616 version also available 1617 `ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1992/92-69.ps.gz' 1618 1619 * Werner Krandick and Tudor Jebelean, "Bidirectional Exact Integer 1620 Division", Journal of Symbolic Computation, volume 21, 1996, pp. 1621 441-455. Early technical report version also available 1622 `ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1994/94-50.ps.gz' 1623 1624 * Makoto Matsumoto and Takuji Nishimura, "Mersenne Twister: A 1625 623-dimensionally equidistributed uniform pseudorandom number 1626 generator", ACM Transactions on Modelling and Computer Simulation, 1627 volume 8, January 1998, pp. 3-30. Available online 1628 `http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/mt.ps.gz' 1629 (or .pdf) 1630 1631 * R. Moenck and A. Borodin, "Fast Modular Transforms via Division", 1632 Proceedings of the 13th Annual IEEE Symposium on Switching and 1633 Automata Theory, October 1972, pp. 90-96. Reprinted as "Fast 1634 Modular Transforms", Journal of Computer and System Sciences, 1635 volume 8, number 3, June 1974, pp. 366-386. 1636 1637 * Niels Mo"ller, "On Scho"nhage's algorithm and subquadratic integer 1638 GCD computation", in Mathematics of Computation, volume 77, 1639 January 2008, pp. 589-607. 1640 1641 * Peter L. Montgomery, "Modular Multiplication Without Trial 1642 Division", in Mathematics of Computation, volume 44, number 170, 1643 April 1985. 1644 1645 * Arnold Scho"nhage and Volker Strassen, "Schnelle Multiplikation 1646 grosser Zahlen", Computing 7, 1971, pp. 281-292. 1647 1648 * Kenneth Weber, "The accelerated integer GCD algorithm", ACM 1649 Transactions on Mathematical Software, volume 21, number 1, March 1650 1995, pp. 111-122. 1651 1652 * Paul Zimmermann, "Karatsuba Square Root", INRIA Research Report 1653 3805, November 1999, `http://www.inria.fr/rrrt/rr-3805.html' 1654 1655 * Paul Zimmermann, "A Proof of GMP Fast Division and Square Root 1656 Implementations", 1657 `http://www.loria.fr/~zimmerma/papers/proof-div-sqrt.ps.gz' 1658 1659 * Dan Zuras, "On Squaring and Multiplying Large Integers", ARITH-11: 1660 IEEE Symposium on Computer Arithmetic, 1993, pp. 260 to 271. 1661 Reprinted as "More on Multiplying and Squaring Large Integers", 1662 IEEE Transactions on Computers, volume 43, number 8, August 1994, 1663 pp. 899-908. 1664 1665 1666File: gmp.info, Node: GNU Free Documentation License, Next: Concept Index, Prev: References, Up: Top 1667 1668Appendix C GNU Free Documentation License 1669***************************************** 1670 1671 Version 1.3, 3 November 2008 1672 1673 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. 1674 `http://fsf.org/' 1675 1676 Everyone is permitted to copy and distribute verbatim copies 1677 of this license document, but changing it is not allowed. 1678 1679 0. PREAMBLE 1680 1681 The purpose of this License is to make a manual, textbook, or other 1682 functional and useful document "free" in the sense of freedom: to 1683 assure everyone the effective freedom to copy and redistribute it, 1684 with or without modifying it, either commercially or 1685 noncommercially. Secondarily, this License preserves for the 1686 author and publisher a way to get credit for their work, while not 1687 being considered responsible for modifications made by others. 1688 1689 This License is a kind of "copyleft", which means that derivative 1690 works of the document must themselves be free in the same sense. 1691 It complements the GNU General Public License, which is a copyleft 1692 license designed for free software. 1693 1694 We have designed this License in order to use it for manuals for 1695 free software, because free software needs free documentation: a 1696 free program should come with manuals providing the same freedoms 1697 that the software does. But this License is not limited to 1698 software manuals; it can be used for any textual work, regardless 1699 of subject matter or whether it is published as a printed book. 1700 We recommend this License principally for works whose purpose is 1701 instruction or reference. 1702 1703 1. APPLICABILITY AND DEFINITIONS 1704 1705 This License applies to any manual or other work, in any medium, 1706 that contains a notice placed by the copyright holder saying it 1707 can be distributed under the terms of this License. Such a notice 1708 grants a world-wide, royalty-free license, unlimited in duration, 1709 to use that work under the conditions stated herein. The 1710 "Document", below, refers to any such manual or work. Any member 1711 of the public is a licensee, and is addressed as "you". You 1712 accept the license if you copy, modify or distribute the work in a 1713 way requiring permission under copyright law. 1714 1715 A "Modified Version" of the Document means any work containing the 1716 Document or a portion of it, either copied verbatim, or with 1717 modifications and/or translated into another language. 1718 1719 A "Secondary Section" is a named appendix or a front-matter section 1720 of the Document that deals exclusively with the relationship of the 1721 publishers or authors of the Document to the Document's overall 1722 subject (or to related matters) and contains nothing that could 1723 fall directly within that overall subject. (Thus, if the Document 1724 is in part a textbook of mathematics, a Secondary Section may not 1725 explain any mathematics.) The relationship could be a matter of 1726 historical connection with the subject or with related matters, or 1727 of legal, commercial, philosophical, ethical or political position 1728 regarding them. 1729 1730 The "Invariant Sections" are certain Secondary Sections whose 1731 titles are designated, as being those of Invariant Sections, in 1732 the notice that says that the Document is released under this 1733 License. If a section does not fit the above definition of 1734 Secondary then it is not allowed to be designated as Invariant. 1735 The Document may contain zero Invariant Sections. If the Document 1736 does not identify any Invariant Sections then there are none. 1737 1738 The "Cover Texts" are certain short passages of text that are 1739 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 1740 that says that the Document is released under this License. A 1741 Front-Cover Text may be at most 5 words, and a Back-Cover Text may 1742 be at most 25 words. 1743 1744 A "Transparent" copy of the Document means a machine-readable copy, 1745 represented in a format whose specification is available to the 1746 general public, that is suitable for revising the document 1747 straightforwardly with generic text editors or (for images 1748 composed of pixels) generic paint programs or (for drawings) some 1749 widely available drawing editor, and that is suitable for input to 1750 text formatters or for automatic translation to a variety of 1751 formats suitable for input to text formatters. A copy made in an 1752 otherwise Transparent file format whose markup, or absence of 1753 markup, has been arranged to thwart or discourage subsequent 1754 modification by readers is not Transparent. An image format is 1755 not Transparent if used for any substantial amount of text. A 1756 copy that is not "Transparent" is called "Opaque". 1757 1758 Examples of suitable formats for Transparent copies include plain 1759 ASCII without markup, Texinfo input format, LaTeX input format, 1760 SGML or XML using a publicly available DTD, and 1761 standard-conforming simple HTML, PostScript or PDF designed for 1762 human modification. Examples of transparent image formats include 1763 PNG, XCF and JPG. Opaque formats include proprietary formats that 1764 can be read and edited only by proprietary word processors, SGML or 1765 XML for which the DTD and/or processing tools are not generally 1766 available, and the machine-generated HTML, PostScript or PDF 1767 produced by some word processors for output purposes only. 1768 1769 The "Title Page" means, for a printed book, the title page itself, 1770 plus such following pages as are needed to hold, legibly, the 1771 material this License requires to appear in the title page. For 1772 works in formats which do not have any title page as such, "Title 1773 Page" means the text near the most prominent appearance of the 1774 work's title, preceding the beginning of the body of the text. 1775 1776 The "publisher" means any person or entity that distributes copies 1777 of the Document to the public. 1778 1779 A section "Entitled XYZ" means a named subunit of the Document 1780 whose title either is precisely XYZ or contains XYZ in parentheses 1781 following text that translates XYZ in another language. (Here XYZ 1782 stands for a specific section name mentioned below, such as 1783 "Acknowledgements", "Dedications", "Endorsements", or "History".) 1784 To "Preserve the Title" of such a section when you modify the 1785 Document means that it remains a section "Entitled XYZ" according 1786 to this definition. 1787 1788 The Document may include Warranty Disclaimers next to the notice 1789 which states that this License applies to the Document. These 1790 Warranty Disclaimers are considered to be included by reference in 1791 this License, but only as regards disclaiming warranties: any other 1792 implication that these Warranty Disclaimers may have is void and 1793 has no effect on the meaning of this License. 1794 1795 2. VERBATIM COPYING 1796 1797 You may copy and distribute the Document in any medium, either 1798 commercially or noncommercially, provided that this License, the 1799 copyright notices, and the license notice saying this License 1800 applies to the Document are reproduced in all copies, and that you 1801 add no other conditions whatsoever to those of this License. You 1802 may not use technical measures to obstruct or control the reading 1803 or further copying of the copies you make or distribute. However, 1804 you may accept compensation in exchange for copies. If you 1805 distribute a large enough number of copies you must also follow 1806 the conditions in section 3. 1807 1808 You may also lend copies, under the same conditions stated above, 1809 and you may publicly display copies. 1810 1811 3. COPYING IN QUANTITY 1812 1813 If you publish printed copies (or copies in media that commonly 1814 have printed covers) of the Document, numbering more than 100, and 1815 the Document's license notice requires Cover Texts, you must 1816 enclose the copies in covers that carry, clearly and legibly, all 1817 these Cover Texts: Front-Cover Texts on the front cover, and 1818 Back-Cover Texts on the back cover. Both covers must also clearly 1819 and legibly identify you as the publisher of these copies. The 1820 front cover must present the full title with all words of the 1821 title equally prominent and visible. You may add other material 1822 on the covers in addition. Copying with changes limited to the 1823 covers, as long as they preserve the title of the Document and 1824 satisfy these conditions, can be treated as verbatim copying in 1825 other respects. 1826 1827 If the required texts for either cover are too voluminous to fit 1828 legibly, you should put the first ones listed (as many as fit 1829 reasonably) on the actual cover, and continue the rest onto 1830 adjacent pages. 1831 1832 If you publish or distribute Opaque copies of the Document 1833 numbering more than 100, you must either include a 1834 machine-readable Transparent copy along with each Opaque copy, or 1835 state in or with each Opaque copy a computer-network location from 1836 which the general network-using public has access to download 1837 using public-standard network protocols a complete Transparent 1838 copy of the Document, free of added material. If you use the 1839 latter option, you must take reasonably prudent steps, when you 1840 begin distribution of Opaque copies in quantity, to ensure that 1841 this Transparent copy will remain thus accessible at the stated 1842 location until at least one year after the last time you 1843 distribute an Opaque copy (directly or through your agents or 1844 retailers) of that edition to the public. 1845 1846 It is requested, but not required, that you contact the authors of 1847 the Document well before redistributing any large number of 1848 copies, to give them a chance to provide you with an updated 1849 version of the Document. 1850 1851 4. MODIFICATIONS 1852 1853 You may copy and distribute a Modified Version of the Document 1854 under the conditions of sections 2 and 3 above, provided that you 1855 release the Modified Version under precisely this License, with 1856 the Modified Version filling the role of the Document, thus 1857 licensing distribution and modification of the Modified Version to 1858 whoever possesses a copy of it. In addition, you must do these 1859 things in the Modified Version: 1860 1861 A. Use in the Title Page (and on the covers, if any) a title 1862 distinct from that of the Document, and from those of 1863 previous versions (which should, if there were any, be listed 1864 in the History section of the Document). You may use the 1865 same title as a previous version if the original publisher of 1866 that version gives permission. 1867 1868 B. List on the Title Page, as authors, one or more persons or 1869 entities responsible for authorship of the modifications in 1870 the Modified Version, together with at least five of the 1871 principal authors of the Document (all of its principal 1872 authors, if it has fewer than five), unless they release you 1873 from this requirement. 1874 1875 C. State on the Title page the name of the publisher of the 1876 Modified Version, as the publisher. 1877 1878 D. Preserve all the copyright notices of the Document. 1879 1880 E. Add an appropriate copyright notice for your modifications 1881 adjacent to the other copyright notices. 1882 1883 F. Include, immediately after the copyright notices, a license 1884 notice giving the public permission to use the Modified 1885 Version under the terms of this License, in the form shown in 1886 the Addendum below. 1887 1888 G. Preserve in that license notice the full lists of Invariant 1889 Sections and required Cover Texts given in the Document's 1890 license notice. 1891 1892 H. Include an unaltered copy of this License. 1893 1894 I. Preserve the section Entitled "History", Preserve its Title, 1895 and add to it an item stating at least the title, year, new 1896 authors, and publisher of the Modified Version as given on 1897 the Title Page. If there is no section Entitled "History" in 1898 the Document, create one stating the title, year, authors, 1899 and publisher of the Document as given on its Title Page, 1900 then add an item describing the Modified Version as stated in 1901 the previous sentence. 1902 1903 J. Preserve the network location, if any, given in the Document 1904 for public access to a Transparent copy of the Document, and 1905 likewise the network locations given in the Document for 1906 previous versions it was based on. These may be placed in 1907 the "History" section. You may omit a network location for a 1908 work that was published at least four years before the 1909 Document itself, or if the original publisher of the version 1910 it refers to gives permission. 1911 1912 K. For any section Entitled "Acknowledgements" or "Dedications", 1913 Preserve the Title of the section, and preserve in the 1914 section all the substance and tone of each of the contributor 1915 acknowledgements and/or dedications given therein. 1916 1917 L. Preserve all the Invariant Sections of the Document, 1918 unaltered in their text and in their titles. Section numbers 1919 or the equivalent are not considered part of the section 1920 titles. 1921 1922 M. Delete any section Entitled "Endorsements". Such a section 1923 may not be included in the Modified Version. 1924 1925 N. Do not retitle any existing section to be Entitled 1926 "Endorsements" or to conflict in title with any Invariant 1927 Section. 1928 1929 O. Preserve any Warranty Disclaimers. 1930 1931 If the Modified Version includes new front-matter sections or 1932 appendices that qualify as Secondary Sections and contain no 1933 material copied from the Document, you may at your option 1934 designate some or all of these sections as invariant. To do this, 1935 add their titles to the list of Invariant Sections in the Modified 1936 Version's license notice. These titles must be distinct from any 1937 other section titles. 1938 1939 You may add a section Entitled "Endorsements", provided it contains 1940 nothing but endorsements of your Modified Version by various 1941 parties--for example, statements of peer review or that the text 1942 has been approved by an organization as the authoritative 1943 definition of a standard. 1944 1945 You may add a passage of up to five words as a Front-Cover Text, 1946 and a passage of up to 25 words as a Back-Cover Text, to the end 1947 of the list of Cover Texts in the Modified Version. Only one 1948 passage of Front-Cover Text and one of Back-Cover Text may be 1949 added by (or through arrangements made by) any one entity. If the 1950 Document already includes a cover text for the same cover, 1951 previously added by you or by arrangement made by the same entity 1952 you are acting on behalf of, you may not add another; but you may 1953 replace the old one, on explicit permission from the previous 1954 publisher that added the old one. 1955 1956 The author(s) and publisher(s) of the Document do not by this 1957 License give permission to use their names for publicity for or to 1958 assert or imply endorsement of any Modified Version. 1959 1960 5. COMBINING DOCUMENTS 1961 1962 You may combine the Document with other documents released under 1963 this License, under the terms defined in section 4 above for 1964 modified versions, provided that you include in the combination 1965 all of the Invariant Sections of all of the original documents, 1966 unmodified, and list them all as Invariant Sections of your 1967 combined work in its license notice, and that you preserve all 1968 their Warranty Disclaimers. 1969 1970 The combined work need only contain one copy of this License, and 1971 multiple identical Invariant Sections may be replaced with a single 1972 copy. If there are multiple Invariant Sections with the same name 1973 but different contents, make the title of each such section unique 1974 by adding at the end of it, in parentheses, the name of the 1975 original author or publisher of that section if known, or else a 1976 unique number. Make the same adjustment to the section titles in 1977 the list of Invariant Sections in the license notice of the 1978 combined work. 1979 1980 In the combination, you must combine any sections Entitled 1981 "History" in the various original documents, forming one section 1982 Entitled "History"; likewise combine any sections Entitled 1983 "Acknowledgements", and any sections Entitled "Dedications". You 1984 must delete all sections Entitled "Endorsements." 1985 1986 6. COLLECTIONS OF DOCUMENTS 1987 1988 You may make a collection consisting of the Document and other 1989 documents released under this License, and replace the individual 1990 copies of this License in the various documents with a single copy 1991 that is included in the collection, provided that you follow the 1992 rules of this License for verbatim copying of each of the 1993 documents in all other respects. 1994 1995 You may extract a single document from such a collection, and 1996 distribute it individually under this License, provided you insert 1997 a copy of this License into the extracted document, and follow 1998 this License in all other respects regarding verbatim copying of 1999 that document. 2000 2001 7. AGGREGATION WITH INDEPENDENT WORKS 2002 2003 A compilation of the Document or its derivatives with other 2004 separate and independent documents or works, in or on a volume of 2005 a storage or distribution medium, is called an "aggregate" if the 2006 copyright resulting from the compilation is not used to limit the 2007 legal rights of the compilation's users beyond what the individual 2008 works permit. When the Document is included in an aggregate, this 2009 License does not apply to the other works in the aggregate which 2010 are not themselves derivative works of the Document. 2011 2012 If the Cover Text requirement of section 3 is applicable to these 2013 copies of the Document, then if the Document is less than one half 2014 of the entire aggregate, the Document's Cover Texts may be placed 2015 on covers that bracket the Document within the aggregate, or the 2016 electronic equivalent of covers if the Document is in electronic 2017 form. Otherwise they must appear on printed covers that bracket 2018 the whole aggregate. 2019 2020 8. TRANSLATION 2021 2022 Translation is considered a kind of modification, so you may 2023 distribute translations of the Document under the terms of section 2024 4. Replacing Invariant Sections with translations requires special 2025 permission from their copyright holders, but you may include 2026 translations of some or all Invariant Sections in addition to the 2027 original versions of these Invariant Sections. You may include a 2028 translation of this License, and all the license notices in the 2029 Document, and any Warranty Disclaimers, provided that you also 2030 include the original English version of this License and the 2031 original versions of those notices and disclaimers. In case of a 2032 disagreement between the translation and the original version of 2033 this License or a notice or disclaimer, the original version will 2034 prevail. 2035 2036 If a section in the Document is Entitled "Acknowledgements", 2037 "Dedications", or "History", the requirement (section 4) to 2038 Preserve its Title (section 1) will typically require changing the 2039 actual title. 2040 2041 9. TERMINATION 2042 2043 You may not copy, modify, sublicense, or distribute the Document 2044 except as expressly provided under this License. Any attempt 2045 otherwise to copy, modify, sublicense, or distribute it is void, 2046 and will automatically terminate your rights under this License. 2047 2048 However, if you cease all violation of this License, then your 2049 license from a particular copyright holder is reinstated (a) 2050 provisionally, unless and until the copyright holder explicitly 2051 and finally terminates your license, and (b) permanently, if the 2052 copyright holder fails to notify you of the violation by some 2053 reasonable means prior to 60 days after the cessation. 2054 2055 Moreover, your license from a particular copyright holder is 2056 reinstated permanently if the copyright holder notifies you of the 2057 violation by some reasonable means, this is the first time you have 2058 received notice of violation of this License (for any work) from 2059 that copyright holder, and you cure the violation prior to 30 days 2060 after your receipt of the notice. 2061 2062 Termination of your rights under this section does not terminate 2063 the licenses of parties who have received copies or rights from 2064 you under this License. If your rights have been terminated and 2065 not permanently reinstated, receipt of a copy of some or all of 2066 the same material does not give you any rights to use it. 2067 2068 10. FUTURE REVISIONS OF THIS LICENSE 2069 2070 The Free Software Foundation may publish new, revised versions of 2071 the GNU Free Documentation License from time to time. Such new 2072 versions will be similar in spirit to the present version, but may 2073 differ in detail to address new problems or concerns. See 2074 `http://www.gnu.org/copyleft/'. 2075 2076 Each version of the License is given a distinguishing version 2077 number. If the Document specifies that a particular numbered 2078 version of this License "or any later version" applies to it, you 2079 have the option of following the terms and conditions either of 2080 that specified version or of any later version that has been 2081 published (not as a draft) by the Free Software Foundation. If 2082 the Document does not specify a version number of this License, 2083 you may choose any version ever published (not as a draft) by the 2084 Free Software Foundation. If the Document specifies that a proxy 2085 can decide which future versions of this License can be used, that 2086 proxy's public statement of acceptance of a version permanently 2087 authorizes you to choose that version for the Document. 2088 2089 11. RELICENSING 2090 2091 "Massive Multiauthor Collaboration Site" (or "MMC Site") means any 2092 World Wide Web server that publishes copyrightable works and also 2093 provides prominent facilities for anybody to edit those works. A 2094 public wiki that anybody can edit is an example of such a server. 2095 A "Massive Multiauthor Collaboration" (or "MMC") contained in the 2096 site means any set of copyrightable works thus published on the MMC 2097 site. 2098 2099 "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 2100 license published by Creative Commons Corporation, a not-for-profit 2101 corporation with a principal place of business in San Francisco, 2102 California, as well as future copyleft versions of that license 2103 published by that same organization. 2104 2105 "Incorporate" means to publish or republish a Document, in whole or 2106 in part, as part of another Document. 2107 2108 An MMC is "eligible for relicensing" if it is licensed under this 2109 License, and if all works that were first published under this 2110 License somewhere other than this MMC, and subsequently 2111 incorporated in whole or in part into the MMC, (1) had no cover 2112 texts or invariant sections, and (2) were thus incorporated prior 2113 to November 1, 2008. 2114 2115 The operator of an MMC Site may republish an MMC contained in the 2116 site under CC-BY-SA on the same site at any time before August 1, 2117 2009, provided the MMC is eligible for relicensing. 2118 2119 2120ADDENDUM: How to use this License for your documents 2121==================================================== 2122 2123To use this License in a document you have written, include a copy of 2124the License in the document and put the following copyright and license 2125notices just after the title page: 2126 2127 Copyright (C) YEAR YOUR NAME. 2128 Permission is granted to copy, distribute and/or modify this document 2129 under the terms of the GNU Free Documentation License, Version 1.3 2130 or any later version published by the Free Software Foundation; 2131 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 2132 Texts. A copy of the license is included in the section entitled ``GNU 2133 Free Documentation License''. 2134 2135 If you have Invariant Sections, Front-Cover Texts and Back-Cover 2136Texts, replace the "with...Texts." line with this: 2137 2138 with the Invariant Sections being LIST THEIR TITLES, with 2139 the Front-Cover Texts being LIST, and with the Back-Cover Texts 2140 being LIST. 2141 2142 If you have Invariant Sections without Cover Texts, or some other 2143combination of the three, merge those two alternatives to suit the 2144situation. 2145 2146 If your document contains nontrivial examples of program code, we 2147recommend releasing these examples in parallel under your choice of 2148free software license, such as the GNU General Public License, to 2149permit their use in free software. 2150 2151 2152File: gmp.info, Node: Concept Index, Next: Function Index, Prev: GNU Free Documentation License, Up: Top 2153 2154Concept Index 2155************* 2156 2157[index] 2158* Menu: 2159 2160* #include: Headers and Libraries. 2161 (line 6) 2162* --build: Build Options. (line 52) 2163* --disable-fft: Build Options. (line 317) 2164* --disable-shared: Build Options. (line 45) 2165* --disable-static: Build Options. (line 45) 2166* --enable-alloca: Build Options. (line 278) 2167* --enable-assert: Build Options. (line 327) 2168* --enable-cxx: Build Options. (line 230) 2169* --enable-fat: Build Options. (line 164) 2170* --enable-mpbsd: Build Options. (line 322) 2171* --enable-profiling <1>: Profiling. (line 6) 2172* --enable-profiling: Build Options. (line 331) 2173* --exec-prefix: Build Options. (line 32) 2174* --host: Build Options. (line 66) 2175* --prefix: Build Options. (line 32) 2176* -finstrument-functions: Profiling. (line 66) 2177* 2exp functions: Efficiency. (line 43) 2178* 68000: Notes for Particular Systems. 2179 (line 80) 2180* 80x86: Notes for Particular Systems. 2181 (line 126) 2182* ABI <1>: Build Options. (line 171) 2183* ABI: ABI and ISA. (line 6) 2184* About this manual: Introduction to GMP. (line 58) 2185* AC_CHECK_LIB: Autoconf. (line 11) 2186* AIX <1>: ABI and ISA. (line 184) 2187* AIX <2>: Notes for Particular Systems. 2188 (line 7) 2189* AIX: ABI and ISA. (line 169) 2190* Algorithms: Algorithms. (line 6) 2191* alloca: Build Options. (line 278) 2192* Allocation of memory: Custom Allocation. (line 6) 2193* AMD64: ABI and ISA. (line 44) 2194* Anonymous FTP of latest version: Introduction to GMP. (line 38) 2195* Application Binary Interface: ABI and ISA. (line 6) 2196* Arithmetic functions <1>: Float Arithmetic. (line 6) 2197* Arithmetic functions <2>: Integer Arithmetic. (line 6) 2198* Arithmetic functions: Rational Arithmetic. (line 6) 2199* ARM: Notes for Particular Systems. 2200 (line 20) 2201* Assembly cache handling: Assembly Cache Handling. 2202 (line 6) 2203* Assembly carry propagation: Assembly Carry Propagation. 2204 (line 6) 2205* Assembly code organisation: Assembly Code Organisation. 2206 (line 6) 2207* Assembly coding: Assembly Coding. (line 6) 2208* Assembly floating Point: Assembly Floating Point. 2209 (line 6) 2210* Assembly loop unrolling: Assembly Loop Unrolling. 2211 (line 6) 2212* Assembly SIMD: Assembly SIMD Instructions. 2213 (line 6) 2214* Assembly software pipelining: Assembly Software Pipelining. 2215 (line 6) 2216* Assembly writing guide: Assembly Writing Guide. 2217 (line 6) 2218* Assertion checking <1>: Debugging. (line 79) 2219* Assertion checking: Build Options. (line 327) 2220* Assignment functions <1>: Assigning Floats. (line 6) 2221* Assignment functions <2>: Initializing Rationals. 2222 (line 6) 2223* Assignment functions <3>: Simultaneous Integer Init & Assign. 2224 (line 6) 2225* Assignment functions <4>: Simultaneous Float Init & Assign. 2226 (line 6) 2227* Assignment functions: Assigning Integers. (line 6) 2228* Autoconf: Autoconf. (line 6) 2229* Basics: GMP Basics. (line 6) 2230* Berkeley MP compatible functions <1>: Build Options. (line 322) 2231* Berkeley MP compatible functions: BSD Compatible Functions. 2232 (line 6) 2233* Binomial coefficient algorithm: Binomial Coefficients Algorithm. 2234 (line 6) 2235* Binomial coefficient functions: Number Theoretic Functions. 2236 (line 100) 2237* Binutils strip: Known Build Problems. 2238 (line 28) 2239* Bit manipulation functions: Integer Logic and Bit Fiddling. 2240 (line 6) 2241* Bit scanning functions: Integer Logic and Bit Fiddling. 2242 (line 38) 2243* Bit shift left: Integer Arithmetic. (line 35) 2244* Bit shift right: Integer Division. (line 53) 2245* Bits per limb: Useful Macros and Constants. 2246 (line 7) 2247* BSD MP compatible functions <1>: Build Options. (line 322) 2248* BSD MP compatible functions: BSD Compatible Functions. 2249 (line 6) 2250* Bug reporting: Reporting Bugs. (line 6) 2251* Build directory: Build Options. (line 19) 2252* Build notes for binary packaging: Notes for Package Builds. 2253 (line 6) 2254* Build notes for particular systems: Notes for Particular Systems. 2255 (line 6) 2256* Build options: Build Options. (line 6) 2257* Build problems known: Known Build Problems. 2258 (line 6) 2259* Build system: Build Options. (line 52) 2260* Building GMP: Installing GMP. (line 6) 2261* Bus error: Debugging. (line 7) 2262* C compiler: Build Options. (line 182) 2263* C++ compiler: Build Options. (line 254) 2264* C++ interface: C++ Class Interface. (line 6) 2265* C++ interface internals: C++ Interface Internals. 2266 (line 6) 2267* C++ istream input: C++ Formatted Input. (line 6) 2268* C++ ostream output: C++ Formatted Output. 2269 (line 6) 2270* C++ support: Build Options. (line 230) 2271* CC: Build Options. (line 182) 2272* CC_FOR_BUILD: Build Options. (line 217) 2273* CFLAGS: Build Options. (line 182) 2274* Checker: Debugging. (line 115) 2275* checkergcc: Debugging. (line 122) 2276* Code organisation: Assembly Code Organisation. 2277 (line 6) 2278* Compaq C++: Notes for Particular Systems. 2279 (line 25) 2280* Comparison functions <1>: Integer Comparisons. (line 6) 2281* Comparison functions <2>: Comparing Rationals. (line 6) 2282* Comparison functions: Float Comparison. (line 6) 2283* Compatibility with older versions: Compatibility with older versions. 2284 (line 6) 2285* Conditions for copying GNU MP: Copying. (line 6) 2286* Configuring GMP: Installing GMP. (line 6) 2287* Congruence algorithm: Exact Remainder. (line 29) 2288* Congruence functions: Integer Division. (line 124) 2289* Constants: Useful Macros and Constants. 2290 (line 6) 2291* Contributors: Contributors. (line 6) 2292* Conventions for parameters: Parameter Conventions. 2293 (line 6) 2294* Conventions for variables: Variable Conventions. 2295 (line 6) 2296* Conversion functions <1>: Converting Integers. (line 6) 2297* Conversion functions <2>: Converting Floats. (line 6) 2298* Conversion functions: Rational Conversions. 2299 (line 6) 2300* Copying conditions: Copying. (line 6) 2301* CPPFLAGS: Build Options. (line 208) 2302* CPU types <1>: Introduction to GMP. (line 24) 2303* CPU types: Build Options. (line 108) 2304* Cross compiling: Build Options. (line 66) 2305* Custom allocation: Custom Allocation. (line 6) 2306* CXX: Build Options. (line 254) 2307* CXXFLAGS: Build Options. (line 254) 2308* Cygwin: Notes for Particular Systems. 2309 (line 43) 2310* Darwin: Known Build Problems. 2311 (line 51) 2312* Debugging: Debugging. (line 6) 2313* Demonstration programs: Demonstration Programs. 2314 (line 6) 2315* Digits in an integer: Miscellaneous Integer Functions. 2316 (line 23) 2317* Divisibility algorithm: Exact Remainder. (line 29) 2318* Divisibility functions: Integer Division. (line 124) 2319* Divisibility testing: Efficiency. (line 91) 2320* Division algorithms: Division Algorithms. (line 6) 2321* Division functions <1>: Rational Arithmetic. (line 22) 2322* Division functions <2>: Integer Division. (line 6) 2323* Division functions: Float Arithmetic. (line 33) 2324* DJGPP <1>: Notes for Particular Systems. 2325 (line 43) 2326* DJGPP: Known Build Problems. 2327 (line 18) 2328* DLLs: Notes for Particular Systems. 2329 (line 56) 2330* DocBook: Build Options. (line 354) 2331* Documentation formats: Build Options. (line 347) 2332* Documentation license: GNU Free Documentation License. 2333 (line 6) 2334* DVI: Build Options. (line 350) 2335* Efficiency: Efficiency. (line 6) 2336* Emacs: Emacs. (line 6) 2337* Exact division functions: Integer Division. (line 102) 2338* Exact remainder: Exact Remainder. (line 6) 2339* Example programs: Demonstration Programs. 2340 (line 6) 2341* Exec prefix: Build Options. (line 32) 2342* Execution profiling <1>: Profiling. (line 6) 2343* Execution profiling: Build Options. (line 331) 2344* Exponentiation functions <1>: Integer Exponentiation. 2345 (line 6) 2346* Exponentiation functions: Float Arithmetic. (line 41) 2347* Export: Integer Import and Export. 2348 (line 45) 2349* Expression parsing demo: Demonstration Programs. 2350 (line 18) 2351* Extended GCD: Number Theoretic Functions. 2352 (line 45) 2353* Factor removal functions: Number Theoretic Functions. 2354 (line 90) 2355* Factorial algorithm: Factorial Algorithm. (line 6) 2356* Factorial functions: Number Theoretic Functions. 2357 (line 95) 2358* Factorization demo: Demonstration Programs. 2359 (line 25) 2360* Fast Fourier Transform: FFT Multiplication. (line 6) 2361* Fat binary: Build Options. (line 164) 2362* FFT multiplication <1>: FFT Multiplication. (line 6) 2363* FFT multiplication: Build Options. (line 317) 2364* Fibonacci number algorithm: Fibonacci Numbers Algorithm. 2365 (line 6) 2366* Fibonacci sequence functions: Number Theoretic Functions. 2367 (line 108) 2368* Float arithmetic functions: Float Arithmetic. (line 6) 2369* Float assignment functions <1>: Simultaneous Float Init & Assign. 2370 (line 6) 2371* Float assignment functions: Assigning Floats. (line 6) 2372* Float comparison functions: Float Comparison. (line 6) 2373* Float conversion functions: Converting Floats. (line 6) 2374* Float functions: Floating-point Functions. 2375 (line 6) 2376* Float initialization functions <1>: Simultaneous Float Init & Assign. 2377 (line 6) 2378* Float initialization functions: Initializing Floats. (line 6) 2379* Float input and output functions: I/O of Floats. (line 6) 2380* Float internals: Float Internals. (line 6) 2381* Float miscellaneous functions: Miscellaneous Float Functions. 2382 (line 6) 2383* Float random number functions: Miscellaneous Float Functions. 2384 (line 27) 2385* Float rounding functions: Miscellaneous Float Functions. 2386 (line 9) 2387* Float sign tests: Float Comparison. (line 33) 2388* Floating point mode: Notes for Particular Systems. 2389 (line 34) 2390* Floating-point functions: Floating-point Functions. 2391 (line 6) 2392* Floating-point number: Nomenclature and Types. 2393 (line 21) 2394* fnccheck: Profiling. (line 77) 2395* Formatted input: Formatted Input. (line 6) 2396* Formatted output: Formatted Output. (line 6) 2397* Free Documentation License: GNU Free Documentation License. 2398 (line 6) 2399* frexp <1>: Converting Floats. (line 23) 2400* frexp: Converting Integers. (line 42) 2401* FTP of latest version: Introduction to GMP. (line 38) 2402* Function classes: Function Classes. (line 6) 2403* FunctionCheck: Profiling. (line 77) 2404* GCC Checker: Debugging. (line 115) 2405* GCD algorithms: Greatest Common Divisor Algorithms. 2406 (line 6) 2407* GCD extended: Number Theoretic Functions. 2408 (line 45) 2409* GCD functions: Number Theoretic Functions. 2410 (line 30) 2411* GDB: Debugging. (line 58) 2412* Generic C: Build Options. (line 153) 2413* GMP Perl module: Demonstration Programs. 2414 (line 35) 2415* GMP version number: Useful Macros and Constants. 2416 (line 12) 2417* gmp.h: Headers and Libraries. 2418 (line 6) 2419* gmpxx.h: C++ Interface General. 2420 (line 8) 2421* GNU Debugger: Debugging. (line 58) 2422* GNU Free Documentation License: GNU Free Documentation License. 2423 (line 6) 2424* GNU strip: Known Build Problems. 2425 (line 28) 2426* gprof: Profiling. (line 41) 2427* Greatest common divisor algorithms: Greatest Common Divisor Algorithms. 2428 (line 6) 2429* Greatest common divisor functions: Number Theoretic Functions. 2430 (line 30) 2431* Hardware floating point mode: Notes for Particular Systems. 2432 (line 34) 2433* Headers: Headers and Libraries. 2434 (line 6) 2435* Heap problems: Debugging. (line 24) 2436* Home page: Introduction to GMP. (line 34) 2437* Host system: Build Options. (line 66) 2438* HP-UX: ABI and ISA. (line 107) 2439* HPPA: ABI and ISA. (line 68) 2440* I/O functions <1>: I/O of Integers. (line 6) 2441* I/O functions <2>: I/O of Rationals. (line 6) 2442* I/O functions: I/O of Floats. (line 6) 2443* i386: Notes for Particular Systems. 2444 (line 126) 2445* IA-64: ABI and ISA. (line 107) 2446* Import: Integer Import and Export. 2447 (line 11) 2448* In-place operations: Efficiency. (line 57) 2449* Include files: Headers and Libraries. 2450 (line 6) 2451* info-lookup-symbol: Emacs. (line 6) 2452* Initialization functions <1>: Initializing Integers. 2453 (line 6) 2454* Initialization functions <2>: Initializing Rationals. 2455 (line 6) 2456* Initialization functions <3>: Random State Initialization. 2457 (line 6) 2458* Initialization functions <4>: Simultaneous Float Init & Assign. 2459 (line 6) 2460* Initialization functions <5>: Simultaneous Integer Init & Assign. 2461 (line 6) 2462* Initialization functions: Initializing Floats. (line 6) 2463* Initializing and clearing: Efficiency. (line 21) 2464* Input functions <1>: I/O of Integers. (line 6) 2465* Input functions <2>: I/O of Rationals. (line 6) 2466* Input functions <3>: I/O of Floats. (line 6) 2467* Input functions: Formatted Input Functions. 2468 (line 6) 2469* Install prefix: Build Options. (line 32) 2470* Installing GMP: Installing GMP. (line 6) 2471* Instruction Set Architecture: ABI and ISA. (line 6) 2472* instrument-functions: Profiling. (line 66) 2473* Integer: Nomenclature and Types. 2474 (line 6) 2475* Integer arithmetic functions: Integer Arithmetic. (line 6) 2476* Integer assignment functions <1>: Simultaneous Integer Init & Assign. 2477 (line 6) 2478* Integer assignment functions: Assigning Integers. (line 6) 2479* Integer bit manipulation functions: Integer Logic and Bit Fiddling. 2480 (line 6) 2481* Integer comparison functions: Integer Comparisons. (line 6) 2482* Integer conversion functions: Converting Integers. (line 6) 2483* Integer division functions: Integer Division. (line 6) 2484* Integer exponentiation functions: Integer Exponentiation. 2485 (line 6) 2486* Integer export: Integer Import and Export. 2487 (line 45) 2488* Integer functions: Integer Functions. (line 6) 2489* Integer import: Integer Import and Export. 2490 (line 11) 2491* Integer initialization functions <1>: Simultaneous Integer Init & Assign. 2492 (line 6) 2493* Integer initialization functions: Initializing Integers. 2494 (line 6) 2495* Integer input and output functions: I/O of Integers. (line 6) 2496* Integer internals: Integer Internals. (line 6) 2497* Integer logical functions: Integer Logic and Bit Fiddling. 2498 (line 6) 2499* Integer miscellaneous functions: Miscellaneous Integer Functions. 2500 (line 6) 2501* Integer random number functions: Integer Random Numbers. 2502 (line 6) 2503* Integer root functions: Integer Roots. (line 6) 2504* Integer sign tests: Integer Comparisons. (line 28) 2505* Integer special functions: Integer Special Functions. 2506 (line 6) 2507* Interix: Notes for Particular Systems. 2508 (line 51) 2509* Internals: Internals. (line 6) 2510* Introduction: Introduction to GMP. (line 6) 2511* Inverse modulo functions: Number Theoretic Functions. 2512 (line 60) 2513* IRIX <1>: Known Build Problems. 2514 (line 38) 2515* IRIX: ABI and ISA. (line 132) 2516* ISA: ABI and ISA. (line 6) 2517* istream input: C++ Formatted Input. (line 6) 2518* Jacobi symbol algorithm: Jacobi Symbol. (line 6) 2519* Jacobi symbol functions: Number Theoretic Functions. 2520 (line 66) 2521* Karatsuba multiplication: Karatsuba Multiplication. 2522 (line 6) 2523* Karatsuba square root algorithm: Square Root Algorithm. 2524 (line 6) 2525* Kronecker symbol functions: Number Theoretic Functions. 2526 (line 78) 2527* Language bindings: Language Bindings. (line 6) 2528* Latest version of GMP: Introduction to GMP. (line 38) 2529* LCM functions: Number Theoretic Functions. 2530 (line 55) 2531* Least common multiple functions: Number Theoretic Functions. 2532 (line 55) 2533* Legendre symbol functions: Number Theoretic Functions. 2534 (line 69) 2535* libgmp: Headers and Libraries. 2536 (line 22) 2537* libgmpxx: Headers and Libraries. 2538 (line 27) 2539* Libraries: Headers and Libraries. 2540 (line 22) 2541* Libtool: Headers and Libraries. 2542 (line 33) 2543* Libtool versioning: Notes for Package Builds. 2544 (line 9) 2545* License conditions: Copying. (line 6) 2546* Limb: Nomenclature and Types. 2547 (line 31) 2548* Limb size: Useful Macros and Constants. 2549 (line 7) 2550* Linear congruential algorithm: Random Number Algorithms. 2551 (line 25) 2552* Linear congruential random numbers: Random State Initialization. 2553 (line 32) 2554* Linking: Headers and Libraries. 2555 (line 22) 2556* Logical functions: Integer Logic and Bit Fiddling. 2557 (line 6) 2558* Low-level functions: Low-level Functions. (line 6) 2559* Lucas number algorithm: Lucas Numbers Algorithm. 2560 (line 6) 2561* Lucas number functions: Number Theoretic Functions. 2562 (line 119) 2563* MacOS X: Known Build Problems. 2564 (line 51) 2565* Mailing lists: Introduction to GMP. (line 45) 2566* Malloc debugger: Debugging. (line 30) 2567* Malloc problems: Debugging. (line 24) 2568* Memory allocation: Custom Allocation. (line 6) 2569* Memory management: Memory Management. (line 6) 2570* Mersenne twister algorithm: Random Number Algorithms. 2571 (line 17) 2572* Mersenne twister random numbers: Random State Initialization. 2573 (line 13) 2574* MINGW: Notes for Particular Systems. 2575 (line 43) 2576* MIPS: ABI and ISA. (line 132) 2577* Miscellaneous float functions: Miscellaneous Float Functions. 2578 (line 6) 2579* Miscellaneous integer functions: Miscellaneous Integer Functions. 2580 (line 6) 2581* MMX: Notes for Particular Systems. 2582 (line 132) 2583* Modular inverse functions: Number Theoretic Functions. 2584 (line 60) 2585* Most significant bit: Miscellaneous Integer Functions. 2586 (line 34) 2587* mp.h: BSD Compatible Functions. 2588 (line 21) 2589* MPN_PATH: Build Options. (line 335) 2590* MS Windows: Notes for Particular Systems. 2591 (line 56) 2592* MS-DOS: Notes for Particular Systems. 2593 (line 43) 2594* Multi-threading: Reentrancy. (line 6) 2595* Multiplication algorithms: Multiplication Algorithms. 2596 (line 6) 2597* Nails: Low-level Functions. (line 479) 2598* Native compilation: Build Options. (line 52) 2599* NeXT: Known Build Problems. 2600 (line 57) 2601* Next prime function: Number Theoretic Functions. 2602 (line 23) 2603* Nomenclature: Nomenclature and Types. 2604 (line 6) 2605* Non-Unix systems: Build Options. (line 11) 2606* Nth root algorithm: Nth Root Algorithm. (line 6) 2607* Number sequences: Efficiency. (line 147) 2608* Number theoretic functions: Number Theoretic Functions. 2609 (line 6) 2610* Numerator and denominator: Applying Integer Functions. 2611 (line 6) 2612* obstack output: Formatted Output Functions. 2613 (line 81) 2614* OpenBSD: Notes for Particular Systems. 2615 (line 86) 2616* Optimizing performance: Performance optimization. 2617 (line 6) 2618* ostream output: C++ Formatted Output. 2619 (line 6) 2620* Other languages: Language Bindings. (line 6) 2621* Output functions <1>: I/O of Floats. (line 6) 2622* Output functions <2>: I/O of Rationals. (line 6) 2623* Output functions <3>: Formatted Output Functions. 2624 (line 6) 2625* Output functions: I/O of Integers. (line 6) 2626* Packaged builds: Notes for Package Builds. 2627 (line 6) 2628* Parameter conventions: Parameter Conventions. 2629 (line 6) 2630* Parsing expressions demo: Demonstration Programs. 2631 (line 21) 2632* Particular systems: Notes for Particular Systems. 2633 (line 6) 2634* Past GMP versions: Compatibility with older versions. 2635 (line 6) 2636* PDF: Build Options. (line 350) 2637* Perfect power algorithm: Perfect Power Algorithm. 2638 (line 6) 2639* Perfect power functions: Integer Roots. (line 27) 2640* Perfect square algorithm: Perfect Square Algorithm. 2641 (line 6) 2642* Perfect square functions: Integer Roots. (line 36) 2643* perl: Demonstration Programs. 2644 (line 35) 2645* Perl module: Demonstration Programs. 2646 (line 35) 2647* Postscript: Build Options. (line 350) 2648* Power/PowerPC <1>: Known Build Problems. 2649 (line 63) 2650* Power/PowerPC: Notes for Particular Systems. 2651 (line 92) 2652* Powering algorithms: Powering Algorithms. (line 6) 2653* Powering functions <1>: Float Arithmetic. (line 41) 2654* Powering functions: Integer Exponentiation. 2655 (line 6) 2656* PowerPC: ABI and ISA. (line 167) 2657* Precision of floats: Floating-point Functions. 2658 (line 6) 2659* Precision of hardware floating point: Notes for Particular Systems. 2660 (line 34) 2661* Prefix: Build Options. (line 32) 2662* Prime testing algorithms: Prime Testing Algorithm. 2663 (line 6) 2664* Prime testing functions: Number Theoretic Functions. 2665 (line 7) 2666* printf formatted output: Formatted Output. (line 6) 2667* Probable prime testing functions: Number Theoretic Functions. 2668 (line 7) 2669* prof: Profiling. (line 24) 2670* Profiling: Profiling. (line 6) 2671* Radix conversion algorithms: Radix Conversion Algorithms. 2672 (line 6) 2673* Random number algorithms: Random Number Algorithms. 2674 (line 6) 2675* Random number functions <1>: Integer Random Numbers. 2676 (line 6) 2677* Random number functions <2>: Miscellaneous Float Functions. 2678 (line 27) 2679* Random number functions: Random Number Functions. 2680 (line 6) 2681* Random number seeding: Random State Seeding. 2682 (line 6) 2683* Random number state: Random State Initialization. 2684 (line 6) 2685* Random state: Nomenclature and Types. 2686 (line 46) 2687* Rational arithmetic: Efficiency. (line 113) 2688* Rational arithmetic functions: Rational Arithmetic. (line 6) 2689* Rational assignment functions: Initializing Rationals. 2690 (line 6) 2691* Rational comparison functions: Comparing Rationals. (line 6) 2692* Rational conversion functions: Rational Conversions. 2693 (line 6) 2694* Rational initialization functions: Initializing Rationals. 2695 (line 6) 2696* Rational input and output functions: I/O of Rationals. (line 6) 2697* Rational internals: Rational Internals. (line 6) 2698* Rational number: Nomenclature and Types. 2699 (line 16) 2700* Rational number functions: Rational Number Functions. 2701 (line 6) 2702* Rational numerator and denominator: Applying Integer Functions. 2703 (line 6) 2704* Rational sign tests: Comparing Rationals. (line 27) 2705* Raw output internals: Raw Output Internals. 2706 (line 6) 2707* Reallocations: Efficiency. (line 30) 2708* Reentrancy: Reentrancy. (line 6) 2709* References: References. (line 6) 2710* Remove factor functions: Number Theoretic Functions. 2711 (line 90) 2712* Reporting bugs: Reporting Bugs. (line 6) 2713* Root extraction algorithm: Nth Root Algorithm. (line 6) 2714* Root extraction algorithms: Root Extraction Algorithms. 2715 (line 6) 2716* Root extraction functions <1>: Float Arithmetic. (line 37) 2717* Root extraction functions: Integer Roots. (line 6) 2718* Root testing functions: Integer Roots. (line 36) 2719* Rounding functions: Miscellaneous Float Functions. 2720 (line 9) 2721* Sample programs: Demonstration Programs. 2722 (line 6) 2723* Scan bit functions: Integer Logic and Bit Fiddling. 2724 (line 38) 2725* scanf formatted input: Formatted Input. (line 6) 2726* SCO: Known Build Problems. 2727 (line 38) 2728* Seeding random numbers: Random State Seeding. 2729 (line 6) 2730* Segmentation violation: Debugging. (line 7) 2731* Sequent Symmetry: Known Build Problems. 2732 (line 68) 2733* Services for Unix: Notes for Particular Systems. 2734 (line 51) 2735* Shared library versioning: Notes for Package Builds. 2736 (line 9) 2737* Sign tests <1>: Float Comparison. (line 33) 2738* Sign tests <2>: Integer Comparisons. (line 28) 2739* Sign tests: Comparing Rationals. (line 27) 2740* Size in digits: Miscellaneous Integer Functions. 2741 (line 23) 2742* Small operands: Efficiency. (line 7) 2743* Solaris <1>: ABI and ISA. (line 201) 2744* Solaris: Known Build Problems. 2745 (line 78) 2746* Sparc: Notes for Particular Systems. 2747 (line 108) 2748* Sparc V9: ABI and ISA. (line 201) 2749* Special integer functions: Integer Special Functions. 2750 (line 6) 2751* Square root algorithm: Square Root Algorithm. 2752 (line 6) 2753* SSE2: Notes for Particular Systems. 2754 (line 132) 2755* Stack backtrace: Debugging. (line 50) 2756* Stack overflow <1>: Debugging. (line 7) 2757* Stack overflow: Build Options. (line 278) 2758* Static linking: Efficiency. (line 14) 2759* stdarg.h: Headers and Libraries. 2760 (line 17) 2761* stdio.h: Headers and Libraries. 2762 (line 11) 2763* Stripped libraries: Known Build Problems. 2764 (line 28) 2765* Sun: ABI and ISA. (line 201) 2766* SunOS: Notes for Particular Systems. 2767 (line 120) 2768* Systems: Notes for Particular Systems. 2769 (line 6) 2770* Temporary memory: Build Options. (line 278) 2771* Texinfo: Build Options. (line 347) 2772* Text input/output: Efficiency. (line 153) 2773* Thread safety: Reentrancy. (line 6) 2774* Toom multiplication <1>: Other Multiplication. 2775 (line 6) 2776* Toom multiplication <2>: Toom 4-Way Multiplication. 2777 (line 6) 2778* Toom multiplication: Toom 3-Way Multiplication. 2779 (line 6) 2780* Types: Nomenclature and Types. 2781 (line 6) 2782* ui and si functions: Efficiency. (line 50) 2783* Unbalanced multiplication: Unbalanced Multiplication. 2784 (line 6) 2785* Upward compatibility: Compatibility with older versions. 2786 (line 6) 2787* Useful macros and constants: Useful Macros and Constants. 2788 (line 6) 2789* User-defined precision: Floating-point Functions. 2790 (line 6) 2791* Valgrind: Debugging. (line 130) 2792* Variable conventions: Variable Conventions. 2793 (line 6) 2794* Version number: Useful Macros and Constants. 2795 (line 12) 2796* Web page: Introduction to GMP. (line 34) 2797* Windows: Notes for Particular Systems. 2798 (line 56) 2799* x86: Notes for Particular Systems. 2800 (line 126) 2801* x87: Notes for Particular Systems. 2802 (line 34) 2803* XML: Build Options. (line 354) 2804 2805 2806File: gmp.info, Node: Function Index, Prev: Concept Index, Up: Top 2807 2808Function and Type Index 2809*********************** 2810 2811[index] 2812* Menu: 2813 2814* __GMP_CC: Useful Macros and Constants. 2815 (line 23) 2816* __GMP_CFLAGS: Useful Macros and Constants. 2817 (line 24) 2818* __GNU_MP_VERSION: Useful Macros and Constants. 2819 (line 10) 2820* __GNU_MP_VERSION_MINOR: Useful Macros and Constants. 2821 (line 11) 2822* __GNU_MP_VERSION_PATCHLEVEL: Useful Macros and Constants. 2823 (line 12) 2824* _mpz_realloc: Integer Special Functions. 2825 (line 51) 2826* abs <1>: C++ Interface Floats. 2827 (line 79) 2828* abs <2>: C++ Interface Rationals. 2829 (line 43) 2830* abs: C++ Interface Integers. 2831 (line 42) 2832* ceil: C++ Interface Floats. 2833 (line 80) 2834* cmp <1>: C++ Interface Floats. 2835 (line 81) 2836* cmp <2>: C++ Interface Integers. 2837 (line 43) 2838* cmp <3>: C++ Interface Floats. 2839 (line 82) 2840* cmp <4>: C++ Interface Rationals. 2841 (line 45) 2842* cmp: C++ Interface Integers. 2843 (line 44) 2844* floor: C++ Interface Floats. 2845 (line 89) 2846* gcd: BSD Compatible Functions. 2847 (line 82) 2848* gmp_asprintf: Formatted Output Functions. 2849 (line 65) 2850* gmp_errno: Random State Initialization. 2851 (line 55) 2852* GMP_ERROR_INVALID_ARGUMENT: Random State Initialization. 2853 (line 55) 2854* GMP_ERROR_UNSUPPORTED_ARGUMENT: Random State Initialization. 2855 (line 55) 2856* gmp_fprintf: Formatted Output Functions. 2857 (line 29) 2858* gmp_fscanf: Formatted Input Functions. 2859 (line 25) 2860* GMP_LIMB_BITS: Low-level Functions. (line 509) 2861* GMP_NAIL_BITS: Low-level Functions. (line 507) 2862* GMP_NAIL_MASK: Low-level Functions. (line 517) 2863* GMP_NUMB_BITS: Low-level Functions. (line 508) 2864* GMP_NUMB_MASK: Low-level Functions. (line 518) 2865* GMP_NUMB_MAX: Low-level Functions. (line 526) 2866* gmp_obstack_printf: Formatted Output Functions. 2867 (line 79) 2868* gmp_obstack_vprintf: Formatted Output Functions. 2869 (line 81) 2870* gmp_printf: Formatted Output Functions. 2871 (line 24) 2872* GMP_RAND_ALG_DEFAULT: Random State Initialization. 2873 (line 49) 2874* GMP_RAND_ALG_LC: Random State Initialization. 2875 (line 49) 2876* gmp_randclass: C++ Interface Random Numbers. 2877 (line 7) 2878* gmp_randclass::get_f: C++ Interface Random Numbers. 2879 (line 45) 2880* gmp_randclass::get_z_bits: C++ Interface Random Numbers. 2881 (line 38) 2882* gmp_randclass::get_z_range: C++ Interface Random Numbers. 2883 (line 42) 2884* gmp_randclass::gmp_randclass: C++ Interface Random Numbers. 2885 (line 27) 2886* gmp_randclass::seed: C++ Interface Random Numbers. 2887 (line 34) 2888* gmp_randclear: Random State Initialization. 2889 (line 62) 2890* gmp_randinit: Random State Initialization. 2891 (line 47) 2892* gmp_randinit_default: Random State Initialization. 2893 (line 7) 2894* gmp_randinit_lc_2exp: Random State Initialization. 2895 (line 18) 2896* gmp_randinit_lc_2exp_size: Random State Initialization. 2897 (line 32) 2898* gmp_randinit_mt: Random State Initialization. 2899 (line 13) 2900* gmp_randinit_set: Random State Initialization. 2901 (line 43) 2902* gmp_randseed: Random State Seeding. 2903 (line 7) 2904* gmp_randseed_ui: Random State Seeding. 2905 (line 9) 2906* gmp_randstate_t: Nomenclature and Types. 2907 (line 46) 2908* gmp_scanf: Formatted Input Functions. 2909 (line 21) 2910* gmp_snprintf: Formatted Output Functions. 2911 (line 46) 2912* gmp_sprintf: Formatted Output Functions. 2913 (line 34) 2914* gmp_sscanf: Formatted Input Functions. 2915 (line 29) 2916* gmp_urandomb_ui: Random State Miscellaneous. 2917 (line 8) 2918* gmp_urandomm_ui: Random State Miscellaneous. 2919 (line 14) 2920* gmp_vasprintf: Formatted Output Functions. 2921 (line 66) 2922* gmp_version: Useful Macros and Constants. 2923 (line 18) 2924* gmp_vfprintf: Formatted Output Functions. 2925 (line 30) 2926* gmp_vfscanf: Formatted Input Functions. 2927 (line 26) 2928* gmp_vprintf: Formatted Output Functions. 2929 (line 25) 2930* gmp_vscanf: Formatted Input Functions. 2931 (line 22) 2932* gmp_vsnprintf: Formatted Output Functions. 2933 (line 48) 2934* gmp_vsprintf: Formatted Output Functions. 2935 (line 35) 2936* gmp_vsscanf: Formatted Input Functions. 2937 (line 31) 2938* hypot: C++ Interface Floats. 2939 (line 90) 2940* itom: BSD Compatible Functions. 2941 (line 29) 2942* madd: BSD Compatible Functions. 2943 (line 43) 2944* mcmp: BSD Compatible Functions. 2945 (line 85) 2946* mdiv: BSD Compatible Functions. 2947 (line 53) 2948* mfree: BSD Compatible Functions. 2949 (line 105) 2950* min: BSD Compatible Functions. 2951 (line 89) 2952* MINT: BSD Compatible Functions. 2953 (line 21) 2954* mout: BSD Compatible Functions. 2955 (line 94) 2956* move: BSD Compatible Functions. 2957 (line 39) 2958* mp_bitcnt_t: Nomenclature and Types. 2959 (line 42) 2960* mp_bits_per_limb: Useful Macros and Constants. 2961 (line 7) 2962* mp_exp_t: Nomenclature and Types. 2963 (line 27) 2964* mp_get_memory_functions: Custom Allocation. (line 93) 2965* mp_limb_t: Nomenclature and Types. 2966 (line 31) 2967* mp_set_memory_functions: Custom Allocation. (line 21) 2968* mp_size_t: Nomenclature and Types. 2969 (line 37) 2970* mpf_abs: Float Arithmetic. (line 47) 2971* mpf_add: Float Arithmetic. (line 7) 2972* mpf_add_ui: Float Arithmetic. (line 9) 2973* mpf_ceil: Miscellaneous Float Functions. 2974 (line 7) 2975* mpf_class: C++ Interface General. 2976 (line 20) 2977* mpf_class::fits_sint_p: C++ Interface Floats. 2978 (line 83) 2979* mpf_class::fits_slong_p: C++ Interface Floats. 2980 (line 84) 2981* mpf_class::fits_sshort_p: C++ Interface Floats. 2982 (line 85) 2983* mpf_class::fits_uint_p: C++ Interface Floats. 2984 (line 86) 2985* mpf_class::fits_ulong_p: C++ Interface Floats. 2986 (line 87) 2987* mpf_class::fits_ushort_p: C++ Interface Floats. 2988 (line 88) 2989* mpf_class::get_d: C++ Interface Floats. 2990 (line 91) 2991* mpf_class::get_mpf_t: C++ Interface General. 2992 (line 66) 2993* mpf_class::get_prec: C++ Interface Floats. 2994 (line 109) 2995* mpf_class::get_si: C++ Interface Floats. 2996 (line 92) 2997* mpf_class::get_str: C++ Interface Floats. 2998 (line 94) 2999* mpf_class::get_ui: C++ Interface Floats. 3000 (line 95) 3001* mpf_class::mpf_class: C++ Interface Floats. 3002 (line 12) 3003* mpf_class::operator=: C++ Interface Floats. 3004 (line 56) 3005* mpf_class::set_prec: C++ Interface Floats. 3006 (line 110) 3007* mpf_class::set_prec_raw: C++ Interface Floats. 3008 (line 111) 3009* mpf_class::set_str: C++ Interface Floats. 3010 (line 97) 3011* mpf_clear: Initializing Floats. (line 37) 3012* mpf_clears: Initializing Floats. (line 41) 3013* mpf_cmp: Float Comparison. (line 7) 3014* mpf_cmp_d: Float Comparison. (line 8) 3015* mpf_cmp_si: Float Comparison. (line 10) 3016* mpf_cmp_ui: Float Comparison. (line 9) 3017* mpf_div: Float Arithmetic. (line 29) 3018* mpf_div_2exp: Float Arithmetic. (line 53) 3019* mpf_div_ui: Float Arithmetic. (line 33) 3020* mpf_eq: Float Comparison. (line 17) 3021* mpf_fits_sint_p: Miscellaneous Float Functions. 3022 (line 20) 3023* mpf_fits_slong_p: Miscellaneous Float Functions. 3024 (line 18) 3025* mpf_fits_sshort_p: Miscellaneous Float Functions. 3026 (line 22) 3027* mpf_fits_uint_p: Miscellaneous Float Functions. 3028 (line 19) 3029* mpf_fits_ulong_p: Miscellaneous Float Functions. 3030 (line 17) 3031* mpf_fits_ushort_p: Miscellaneous Float Functions. 3032 (line 21) 3033* mpf_floor: Miscellaneous Float Functions. 3034 (line 8) 3035* mpf_get_d: Converting Floats. (line 7) 3036* mpf_get_d_2exp: Converting Floats. (line 16) 3037* mpf_get_default_prec: Initializing Floats. (line 12) 3038* mpf_get_prec: Initializing Floats. (line 62) 3039* mpf_get_si: Converting Floats. (line 27) 3040* mpf_get_str: Converting Floats. (line 37) 3041* mpf_get_ui: Converting Floats. (line 28) 3042* mpf_init: Initializing Floats. (line 19) 3043* mpf_init2: Initializing Floats. (line 26) 3044* mpf_init_set: Simultaneous Float Init & Assign. 3045 (line 16) 3046* mpf_init_set_d: Simultaneous Float Init & Assign. 3047 (line 19) 3048* mpf_init_set_si: Simultaneous Float Init & Assign. 3049 (line 18) 3050* mpf_init_set_str: Simultaneous Float Init & Assign. 3051 (line 25) 3052* mpf_init_set_ui: Simultaneous Float Init & Assign. 3053 (line 17) 3054* mpf_inits: Initializing Floats. (line 31) 3055* mpf_inp_str: I/O of Floats. (line 39) 3056* mpf_integer_p: Miscellaneous Float Functions. 3057 (line 14) 3058* mpf_mul: Float Arithmetic. (line 19) 3059* mpf_mul_2exp: Float Arithmetic. (line 50) 3060* mpf_mul_ui: Float Arithmetic. (line 21) 3061* mpf_neg: Float Arithmetic. (line 44) 3062* mpf_out_str: I/O of Floats. (line 19) 3063* mpf_pow_ui: Float Arithmetic. (line 41) 3064* mpf_random2: Miscellaneous Float Functions. 3065 (line 37) 3066* mpf_reldiff: Float Comparison. (line 29) 3067* mpf_set: Assigning Floats. (line 10) 3068* mpf_set_d: Assigning Floats. (line 13) 3069* mpf_set_default_prec: Initializing Floats. (line 7) 3070* mpf_set_prec: Initializing Floats. (line 65) 3071* mpf_set_prec_raw: Initializing Floats. (line 72) 3072* mpf_set_q: Assigning Floats. (line 15) 3073* mpf_set_si: Assigning Floats. (line 12) 3074* mpf_set_str: Assigning Floats. (line 18) 3075* mpf_set_ui: Assigning Floats. (line 11) 3076* mpf_set_z: Assigning Floats. (line 14) 3077* mpf_sgn: Float Comparison. (line 33) 3078* mpf_sqrt: Float Arithmetic. (line 36) 3079* mpf_sqrt_ui: Float Arithmetic. (line 37) 3080* mpf_sub: Float Arithmetic. (line 12) 3081* mpf_sub_ui: Float Arithmetic. (line 16) 3082* mpf_swap: Assigning Floats. (line 52) 3083* mpf_t: Nomenclature and Types. 3084 (line 21) 3085* mpf_trunc: Miscellaneous Float Functions. 3086 (line 9) 3087* mpf_ui_div: Float Arithmetic. (line 31) 3088* mpf_ui_sub: Float Arithmetic. (line 14) 3089* mpf_urandomb: Miscellaneous Float Functions. 3090 (line 27) 3091* mpn_add: Low-level Functions. (line 69) 3092* mpn_add_1: Low-level Functions. (line 64) 3093* mpn_add_n: Low-level Functions. (line 54) 3094* mpn_addmul_1: Low-level Functions. (line 148) 3095* mpn_and_n: Low-level Functions. (line 421) 3096* mpn_andn_n: Low-level Functions. (line 436) 3097* mpn_cmp: Low-level Functions. (line 284) 3098* mpn_com: Low-level Functions. (line 461) 3099* mpn_copyd: Low-level Functions. (line 470) 3100* mpn_copyi: Low-level Functions. (line 466) 3101* mpn_divexact_by3: Low-level Functions. (line 229) 3102* mpn_divexact_by3c: Low-level Functions. (line 231) 3103* mpn_divmod: Low-level Functions. (line 224) 3104* mpn_divmod_1: Low-level Functions. (line 208) 3105* mpn_divrem: Low-level Functions. (line 182) 3106* mpn_divrem_1: Low-level Functions. (line 206) 3107* mpn_gcd: Low-level Functions. (line 289) 3108* mpn_gcd_1: Low-level Functions. (line 299) 3109* mpn_gcdext: Low-level Functions. (line 305) 3110* mpn_get_str: Low-level Functions. (line 346) 3111* mpn_hamdist: Low-level Functions. (line 410) 3112* mpn_ior_n: Low-level Functions. (line 426) 3113* mpn_iorn_n: Low-level Functions. (line 441) 3114* mpn_lshift: Low-level Functions. (line 260) 3115* mpn_mod_1: Low-level Functions. (line 255) 3116* mpn_mul: Low-level Functions. (line 114) 3117* mpn_mul_1: Low-level Functions. (line 133) 3118* mpn_mul_n: Low-level Functions. (line 103) 3119* mpn_nand_n: Low-level Functions. (line 446) 3120* mpn_neg: Low-level Functions. (line 98) 3121* mpn_nior_n: Low-level Functions. (line 451) 3122* mpn_perfect_square_p: Low-level Functions. (line 416) 3123* mpn_popcount: Low-level Functions. (line 406) 3124* mpn_random: Low-level Functions. (line 395) 3125* mpn_random2: Low-level Functions. (line 396) 3126* mpn_rshift: Low-level Functions. (line 272) 3127* mpn_scan0: Low-level Functions. (line 380) 3128* mpn_scan1: Low-level Functions. (line 388) 3129* mpn_set_str: Low-level Functions. (line 361) 3130* mpn_sqr: Low-level Functions. (line 125) 3131* mpn_sqrtrem: Low-level Functions. (line 328) 3132* mpn_sub: Low-level Functions. (line 90) 3133* mpn_sub_1: Low-level Functions. (line 85) 3134* mpn_sub_n: Low-level Functions. (line 76) 3135* mpn_submul_1: Low-level Functions. (line 159) 3136* mpn_tdiv_qr: Low-level Functions. (line 171) 3137* mpn_xnor_n: Low-level Functions. (line 456) 3138* mpn_xor_n: Low-level Functions. (line 431) 3139* mpn_zero: Low-level Functions. (line 473) 3140* mpq_abs: Rational Arithmetic. (line 31) 3141* mpq_add: Rational Arithmetic. (line 7) 3142* mpq_canonicalize: Rational Number Functions. 3143 (line 22) 3144* mpq_class: C++ Interface General. 3145 (line 19) 3146* mpq_class::canonicalize: C++ Interface Rationals. 3147 (line 37) 3148* mpq_class::get_d: C++ Interface Rationals. 3149 (line 46) 3150* mpq_class::get_den: C++ Interface Rationals. 3151 (line 58) 3152* mpq_class::get_den_mpz_t: C++ Interface Rationals. 3153 (line 68) 3154* mpq_class::get_mpq_t: C++ Interface General. 3155 (line 65) 3156* mpq_class::get_num: C++ Interface Rationals. 3157 (line 57) 3158* mpq_class::get_num_mpz_t: C++ Interface Rationals. 3159 (line 67) 3160* mpq_class::get_str: C++ Interface Rationals. 3161 (line 47) 3162* mpq_class::mpq_class: C++ Interface Rationals. 3163 (line 30) 3164* mpq_class::set_str: C++ Interface Rationals. 3165 (line 48) 3166* mpq_clear: Initializing Rationals. 3167 (line 16) 3168* mpq_clears: Initializing Rationals. 3169 (line 20) 3170* mpq_cmp: Comparing Rationals. (line 7) 3171* mpq_cmp_si: Comparing Rationals. (line 17) 3172* mpq_cmp_ui: Comparing Rationals. (line 15) 3173* mpq_denref: Applying Integer Functions. 3174 (line 18) 3175* mpq_div: Rational Arithmetic. (line 22) 3176* mpq_div_2exp: Rational Arithmetic. (line 25) 3177* mpq_equal: Comparing Rationals. (line 33) 3178* mpq_get_d: Rational Conversions. 3179 (line 7) 3180* mpq_get_den: Applying Integer Functions. 3181 (line 24) 3182* mpq_get_num: Applying Integer Functions. 3183 (line 23) 3184* mpq_get_str: Rational Conversions. 3185 (line 22) 3186* mpq_init: Initializing Rationals. 3187 (line 7) 3188* mpq_inits: Initializing Rationals. 3189 (line 12) 3190* mpq_inp_str: I/O of Rationals. (line 26) 3191* mpq_inv: Rational Arithmetic. (line 34) 3192* mpq_mul: Rational Arithmetic. (line 15) 3193* mpq_mul_2exp: Rational Arithmetic. (line 18) 3194* mpq_neg: Rational Arithmetic. (line 28) 3195* mpq_numref: Applying Integer Functions. 3196 (line 17) 3197* mpq_out_str: I/O of Rationals. (line 18) 3198* mpq_set: Initializing Rationals. 3199 (line 24) 3200* mpq_set_d: Rational Conversions. 3201 (line 17) 3202* mpq_set_den: Applying Integer Functions. 3203 (line 26) 3204* mpq_set_f: Rational Conversions. 3205 (line 18) 3206* mpq_set_num: Applying Integer Functions. 3207 (line 25) 3208* mpq_set_si: Initializing Rationals. 3209 (line 31) 3210* mpq_set_str: Initializing Rationals. 3211 (line 36) 3212* mpq_set_ui: Initializing Rationals. 3213 (line 29) 3214* mpq_set_z: Initializing Rationals. 3215 (line 25) 3216* mpq_sgn: Comparing Rationals. (line 27) 3217* mpq_sub: Rational Arithmetic. (line 11) 3218* mpq_swap: Initializing Rationals. 3219 (line 56) 3220* mpq_t: Nomenclature and Types. 3221 (line 16) 3222* mpz_abs: Integer Arithmetic. (line 42) 3223* mpz_add: Integer Arithmetic. (line 7) 3224* mpz_add_ui: Integer Arithmetic. (line 9) 3225* mpz_addmul: Integer Arithmetic. (line 25) 3226* mpz_addmul_ui: Integer Arithmetic. (line 27) 3227* mpz_and: Integer Logic and Bit Fiddling. 3228 (line 11) 3229* mpz_array_init: Integer Special Functions. 3230 (line 11) 3231* mpz_bin_ui: Number Theoretic Functions. 3232 (line 98) 3233* mpz_bin_uiui: Number Theoretic Functions. 3234 (line 100) 3235* mpz_cdiv_q: Integer Division. (line 13) 3236* mpz_cdiv_q_2exp: Integer Division. (line 24) 3237* mpz_cdiv_q_ui: Integer Division. (line 17) 3238* mpz_cdiv_qr: Integer Division. (line 15) 3239* mpz_cdiv_qr_ui: Integer Division. (line 21) 3240* mpz_cdiv_r: Integer Division. (line 14) 3241* mpz_cdiv_r_2exp: Integer Division. (line 25) 3242* mpz_cdiv_r_ui: Integer Division. (line 19) 3243* mpz_cdiv_ui: Integer Division. (line 23) 3244* mpz_class: C++ Interface General. 3245 (line 18) 3246* mpz_class::fits_sint_p: C++ Interface Integers. 3247 (line 45) 3248* mpz_class::fits_slong_p: C++ Interface Integers. 3249 (line 46) 3250* mpz_class::fits_sshort_p: C++ Interface Integers. 3251 (line 47) 3252* mpz_class::fits_uint_p: C++ Interface Integers. 3253 (line 48) 3254* mpz_class::fits_ulong_p: C++ Interface Integers. 3255 (line 49) 3256* mpz_class::fits_ushort_p: C++ Interface Integers. 3257 (line 50) 3258* mpz_class::get_d: C++ Interface Integers. 3259 (line 51) 3260* mpz_class::get_mpz_t: C++ Interface General. 3261 (line 64) 3262* mpz_class::get_si: C++ Interface Integers. 3263 (line 52) 3264* mpz_class::get_str: C++ Interface Integers. 3265 (line 53) 3266* mpz_class::get_ui: C++ Interface Integers. 3267 (line 54) 3268* mpz_class::mpz_class: C++ Interface Integers. 3269 (line 20) 3270* mpz_class::set_str: C++ Interface Integers. 3271 (line 55) 3272* mpz_clear: Initializing Integers. 3273 (line 44) 3274* mpz_clears: Initializing Integers. 3275 (line 48) 3276* mpz_clrbit: Integer Logic and Bit Fiddling. 3277 (line 54) 3278* mpz_cmp: Integer Comparisons. (line 7) 3279* mpz_cmp_d: Integer Comparisons. (line 8) 3280* mpz_cmp_si: Integer Comparisons. (line 9) 3281* mpz_cmp_ui: Integer Comparisons. (line 10) 3282* mpz_cmpabs: Integer Comparisons. (line 18) 3283* mpz_cmpabs_d: Integer Comparisons. (line 19) 3284* mpz_cmpabs_ui: Integer Comparisons. (line 20) 3285* mpz_com: Integer Logic and Bit Fiddling. 3286 (line 20) 3287* mpz_combit: Integer Logic and Bit Fiddling. 3288 (line 57) 3289* mpz_congruent_2exp_p: Integer Division. (line 124) 3290* mpz_congruent_p: Integer Division. (line 121) 3291* mpz_congruent_ui_p: Integer Division. (line 123) 3292* mpz_divexact: Integer Division. (line 101) 3293* mpz_divexact_ui: Integer Division. (line 102) 3294* mpz_divisible_2exp_p: Integer Division. (line 112) 3295* mpz_divisible_p: Integer Division. (line 110) 3296* mpz_divisible_ui_p: Integer Division. (line 111) 3297* mpz_even_p: Miscellaneous Integer Functions. 3298 (line 18) 3299* mpz_export: Integer Import and Export. 3300 (line 45) 3301* mpz_fac_ui: Number Theoretic Functions. 3302 (line 95) 3303* mpz_fdiv_q: Integer Division. (line 27) 3304* mpz_fdiv_q_2exp: Integer Division. (line 38) 3305* mpz_fdiv_q_ui: Integer Division. (line 31) 3306* mpz_fdiv_qr: Integer Division. (line 29) 3307* mpz_fdiv_qr_ui: Integer Division. (line 35) 3308* mpz_fdiv_r: Integer Division. (line 28) 3309* mpz_fdiv_r_2exp: Integer Division. (line 39) 3310* mpz_fdiv_r_ui: Integer Division. (line 33) 3311* mpz_fdiv_ui: Integer Division. (line 37) 3312* mpz_fib2_ui: Number Theoretic Functions. 3313 (line 108) 3314* mpz_fib_ui: Number Theoretic Functions. 3315 (line 106) 3316* mpz_fits_sint_p: Miscellaneous Integer Functions. 3317 (line 10) 3318* mpz_fits_slong_p: Miscellaneous Integer Functions. 3319 (line 8) 3320* mpz_fits_sshort_p: Miscellaneous Integer Functions. 3321 (line 12) 3322* mpz_fits_uint_p: Miscellaneous Integer Functions. 3323 (line 9) 3324* mpz_fits_ulong_p: Miscellaneous Integer Functions. 3325 (line 7) 3326* mpz_fits_ushort_p: Miscellaneous Integer Functions. 3327 (line 11) 3328* mpz_gcd: Number Theoretic Functions. 3329 (line 30) 3330* mpz_gcd_ui: Number Theoretic Functions. 3331 (line 35) 3332* mpz_gcdext: Number Theoretic Functions. 3333 (line 45) 3334* mpz_get_d: Converting Integers. (line 27) 3335* mpz_get_d_2exp: Converting Integers. (line 35) 3336* mpz_get_si: Converting Integers. (line 18) 3337* mpz_get_str: Converting Integers. (line 46) 3338* mpz_get_ui: Converting Integers. (line 11) 3339* mpz_getlimbn: Integer Special Functions. 3340 (line 60) 3341* mpz_hamdist: Integer Logic and Bit Fiddling. 3342 (line 29) 3343* mpz_import: Integer Import and Export. 3344 (line 11) 3345* mpz_init: Initializing Integers. 3346 (line 26) 3347* mpz_init2: Initializing Integers. 3348 (line 33) 3349* mpz_init_set: Simultaneous Integer Init & Assign. 3350 (line 27) 3351* mpz_init_set_d: Simultaneous Integer Init & Assign. 3352 (line 30) 3353* mpz_init_set_si: Simultaneous Integer Init & Assign. 3354 (line 29) 3355* mpz_init_set_str: Simultaneous Integer Init & Assign. 3356 (line 34) 3357* mpz_init_set_ui: Simultaneous Integer Init & Assign. 3358 (line 28) 3359* mpz_inits: Initializing Integers. 3360 (line 29) 3361* mpz_inp_raw: I/O of Integers. (line 61) 3362* mpz_inp_str: I/O of Integers. (line 30) 3363* mpz_invert: Number Theoretic Functions. 3364 (line 60) 3365* mpz_ior: Integer Logic and Bit Fiddling. 3366 (line 14) 3367* mpz_jacobi: Number Theoretic Functions. 3368 (line 66) 3369* mpz_kronecker: Number Theoretic Functions. 3370 (line 74) 3371* mpz_kronecker_si: Number Theoretic Functions. 3372 (line 75) 3373* mpz_kronecker_ui: Number Theoretic Functions. 3374 (line 76) 3375* mpz_lcm: Number Theoretic Functions. 3376 (line 54) 3377* mpz_lcm_ui: Number Theoretic Functions. 3378 (line 55) 3379* mpz_legendre: Number Theoretic Functions. 3380 (line 69) 3381* mpz_lucnum2_ui: Number Theoretic Functions. 3382 (line 119) 3383* mpz_lucnum_ui: Number Theoretic Functions. 3384 (line 117) 3385* mpz_mod: Integer Division. (line 91) 3386* mpz_mod_ui: Integer Division. (line 93) 3387* mpz_mul: Integer Arithmetic. (line 19) 3388* mpz_mul_2exp: Integer Arithmetic. (line 35) 3389* mpz_mul_si: Integer Arithmetic. (line 20) 3390* mpz_mul_ui: Integer Arithmetic. (line 22) 3391* mpz_neg: Integer Arithmetic. (line 39) 3392* mpz_nextprime: Number Theoretic Functions. 3393 (line 23) 3394* mpz_odd_p: Miscellaneous Integer Functions. 3395 (line 17) 3396* mpz_out_raw: I/O of Integers. (line 45) 3397* mpz_out_str: I/O of Integers. (line 18) 3398* mpz_perfect_power_p: Integer Roots. (line 27) 3399* mpz_perfect_square_p: Integer Roots. (line 36) 3400* mpz_popcount: Integer Logic and Bit Fiddling. 3401 (line 23) 3402* mpz_pow_ui: Integer Exponentiation. 3403 (line 31) 3404* mpz_powm: Integer Exponentiation. 3405 (line 8) 3406* mpz_powm_sec: Integer Exponentiation. 3407 (line 18) 3408* mpz_powm_ui: Integer Exponentiation. 3409 (line 10) 3410* mpz_probab_prime_p: Number Theoretic Functions. 3411 (line 7) 3412* mpz_random: Integer Random Numbers. 3413 (line 42) 3414* mpz_random2: Integer Random Numbers. 3415 (line 51) 3416* mpz_realloc2: Initializing Integers. 3417 (line 52) 3418* mpz_remove: Number Theoretic Functions. 3419 (line 90) 3420* mpz_root: Integer Roots. (line 7) 3421* mpz_rootrem: Integer Roots. (line 13) 3422* mpz_rrandomb: Integer Random Numbers. 3423 (line 31) 3424* mpz_scan0: Integer Logic and Bit Fiddling. 3425 (line 37) 3426* mpz_scan1: Integer Logic and Bit Fiddling. 3427 (line 38) 3428* mpz_set: Assigning Integers. (line 10) 3429* mpz_set_d: Assigning Integers. (line 13) 3430* mpz_set_f: Assigning Integers. (line 15) 3431* mpz_set_q: Assigning Integers. (line 14) 3432* mpz_set_si: Assigning Integers. (line 12) 3433* mpz_set_str: Assigning Integers. (line 21) 3434* mpz_set_ui: Assigning Integers. (line 11) 3435* mpz_setbit: Integer Logic and Bit Fiddling. 3436 (line 51) 3437* mpz_sgn: Integer Comparisons. (line 28) 3438* mpz_si_kronecker: Number Theoretic Functions. 3439 (line 77) 3440* mpz_size: Integer Special Functions. 3441 (line 68) 3442* mpz_sizeinbase: Miscellaneous Integer Functions. 3443 (line 23) 3444* mpz_sqrt: Integer Roots. (line 17) 3445* mpz_sqrtrem: Integer Roots. (line 20) 3446* mpz_sub: Integer Arithmetic. (line 12) 3447* mpz_sub_ui: Integer Arithmetic. (line 14) 3448* mpz_submul: Integer Arithmetic. (line 30) 3449* mpz_submul_ui: Integer Arithmetic. (line 32) 3450* mpz_swap: Assigning Integers. (line 37) 3451* mpz_t: Nomenclature and Types. 3452 (line 6) 3453* mpz_tdiv_q: Integer Division. (line 41) 3454* mpz_tdiv_q_2exp: Integer Division. (line 52) 3455* mpz_tdiv_q_ui: Integer Division. (line 45) 3456* mpz_tdiv_qr: Integer Division. (line 43) 3457* mpz_tdiv_qr_ui: Integer Division. (line 49) 3458* mpz_tdiv_r: Integer Division. (line 42) 3459* mpz_tdiv_r_2exp: Integer Division. (line 53) 3460* mpz_tdiv_r_ui: Integer Division. (line 47) 3461* mpz_tdiv_ui: Integer Division. (line 51) 3462* mpz_tstbit: Integer Logic and Bit Fiddling. 3463 (line 60) 3464* mpz_ui_kronecker: Number Theoretic Functions. 3465 (line 78) 3466* mpz_ui_pow_ui: Integer Exponentiation. 3467 (line 33) 3468* mpz_ui_sub: Integer Arithmetic. (line 16) 3469* mpz_urandomb: Integer Random Numbers. 3470 (line 14) 3471* mpz_urandomm: Integer Random Numbers. 3472 (line 23) 3473* mpz_xor: Integer Logic and Bit Fiddling. 3474 (line 17) 3475* msqrt: BSD Compatible Functions. 3476 (line 63) 3477* msub: BSD Compatible Functions. 3478 (line 46) 3479* mtox: BSD Compatible Functions. 3480 (line 98) 3481* mult: BSD Compatible Functions. 3482 (line 49) 3483* operator%: C++ Interface Integers. 3484 (line 30) 3485* operator/: C++ Interface Integers. 3486 (line 29) 3487* operator<<: C++ Formatted Output. 3488 (line 11) 3489* operator>> <1>: C++ Formatted Input. (line 11) 3490* operator>> <2>: C++ Interface Rationals. 3491 (line 77) 3492* operator>>: C++ Formatted Input. (line 14) 3493* pow: BSD Compatible Functions. 3494 (line 71) 3495* rpow: BSD Compatible Functions. 3496 (line 79) 3497* sdiv: BSD Compatible Functions. 3498 (line 55) 3499* sgn <1>: C++ Interface Rationals. 3500 (line 50) 3501* sgn <2>: C++ Interface Integers. 3502 (line 57) 3503* sgn: C++ Interface Floats. 3504 (line 98) 3505* sqrt <1>: C++ Interface Floats. 3506 (line 99) 3507* sqrt: C++ Interface Integers. 3508 (line 58) 3509* trunc: C++ Interface Floats. 3510 (line 100) 3511* xtom: BSD Compatible Functions. 3512 (line 34) 3513 3514 3515