home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / python / pytex / pytexdoc / lib2 / mpz / tex / node1_ct.html < prev    next >
LaTeX Document  |  1996-11-08  |  3.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
90% dexvert Hypertext Markup Language File (text/html) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file HTML document text default (weak)
99% file LaTeX document text default
98% file exported SGML document text default
97% file exported SGML document, ASCII text default
80% TrID HyperText Markup Language with DOCTYPE default
19% TrID HyperText Markup Language default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% gt2 HTML (Hyper Text Markup Language) Datei default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime text/html default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 3c 21 44 4f 43 54 59 50 | 45 20 48 54 4d 4c 20 50 |<!DOCTYP|E HTML P|
|00000010| 55 42 4c 49 43 20 22 2d | 2f 2f 57 33 43 2f 2f 44 |UBLIC "-|//W3C//D|
|00000020| 54 44 20 48 54 4d 4c 20 | 33 2e 32 20 46 69 6e 61 |TD HTML |3.2 Fina|
|00000030| 6c 2f 2f 65 6e 22 3e 0a | 0a 3c 21 2d 2d 43 6f 6e |l//en">.|.<!--Con|
|00000040| 76 65 72 74 65 64 20 77 | 69 74 68 20 4c 61 54 65 |verted w|ith LaTe|
|00000050| 58 32 48 54 4d 4c 20 32 | 30 32 32 20 28 52 65 6c |X2HTML 2|022 (Rel|
|00000060| 65 61 73 65 64 20 4a 61 | 6e 75 61 72 79 20 31 2c |eased Ja|nuary 1,|
|00000070| 20 32 30 32 32 29 20 2d | 2d 3e 0a 3c 48 54 4d 4c | 2022) -|->.<HTML|
|00000080| 20 6c 61 6e 67 3d 22 65 | 6e 22 3e 0a 3c 48 45 41 | lang="e|n">.<HEA|
|00000090| 44 3e 0a 3c 54 49 54 4c | 45 3e 43 6f 6e 74 65 6e |D>.<TITL|E>Conten|
|000000a0| 74 73 20 6f 66 20 42 75 | 69 6c 74 2d 69 6e 20 4d |ts of Bu|ilt-in M|
|000000b0| 6f 64 75 6c 65 20 6d 70 | 7a 3c 2f 54 49 54 4c 45 |odule mp|z</TITLE|
|000000c0| 3e 0a 0a 3c 4d 45 54 41 | 20 48 54 54 50 2d 45 51 |>..<META| HTTP-EQ|
|000000d0| 55 49 56 3d 22 43 6f 6e | 74 65 6e 74 2d 54 79 70 |UIV="Con|tent-Typ|
|000000e0| 65 22 20 43 4f 4e 54 45 | 4e 54 3d 22 74 65 78 74 |e" CONTE|NT="text|
|000000f0| 2f 68 74 6d 6c 3b 20 63 | 68 61 72 73 65 74 3d 75 |/html; c|harset=u|
|00000100| 74 66 2d 38 22 3e 0a 3c | 4d 45 54 41 20 4e 41 4d |tf-8">.<|META NAM|
|00000110| 45 3d 22 76 69 65 77 70 | 6f 72 74 22 20 43 4f 4e |E="viewp|ort" CON|
|00000120| 54 45 4e 54 3d 22 77 69 | 64 74 68 3d 64 65 76 69 |TENT="wi|dth=devi|
|00000130| 63 65 2d 77 69 64 74 68 | 2c 20 69 6e 69 74 69 61 |ce-width|, initia|
|00000140| 6c 2d 73 63 61 6c 65 3d | 31 2e 30 22 3e 0a 3c 4d |l-scale=|1.0">.<M|
|00000150| 45 54 41 20 4e 41 4d 45 | 3d 22 47 65 6e 65 72 61 |ETA NAME|="Genera|
|00000160| 74 6f 72 22 20 43 4f 4e | 54 45 4e 54 3d 22 4c 61 |tor" CON|TENT="La|
|00000170| 54 65 58 32 48 54 4d 4c | 20 76 32 30 32 32 22 3e |TeX2HTML| v2022">|
|00000180| 0a 0a 3c 4c 49 4e 4b 20 | 52 45 4c 3d 22 53 54 59 |..<LINK |REL="STY|
|00000190| 4c 45 53 48 45 45 54 22 | 20 48 52 45 46 3d 22 74 |LESHEET"| HREF="t|
|000001a0| 65 78 2e 63 73 73 22 3e | 0a 0a 3c 4c 49 4e 4b 20 |ex.css">|..<LINK |
|000001b0| 52 45 4c 3d 22 70 72 65 | 76 69 6f 75 73 22 20 48 |REL="pre|vious" H|
|000001c0| 52 45 46 3d 22 74 65 78 | 5f 6d 6e 2e 68 74 6d 6c |REF="tex|_mn.html|
|000001d0| 22 3e 0a 3c 4c 49 4e 4b | 20 52 45 4c 3d 22 75 70 |">.<LINK| REL="up|
|000001e0| 22 20 48 52 45 46 3d 22 | 74 65 78 5f 6d 6e 2e 68 |" HREF="|tex_mn.h|
|000001f0| 74 6d 6c 22 3e 0a 3c 2f | 48 45 41 44 3e 0a 20 0a |tml">.</|HEAD>. .|
|00000200| 3c 42 4f 44 59 20 62 67 | 63 6f 6c 6f 72 3d 22 23 |<BODY bg|color="#|
|00000210| 66 66 66 66 66 66 22 20 | 74 65 78 74 3d 22 23 30 |ffffff" |text="#0|
|00000220| 30 30 30 30 30 22 20 6c | 69 6e 6b 3d 22 23 39 39 |00000" l|ink="#99|
|00000230| 34 34 45 45 22 20 76 6c | 69 6e 6b 3d 22 23 30 30 |44EE" vl|ink="#00|
|00000240| 30 30 66 66 22 20 61 6c | 69 6e 6b 3d 22 23 30 30 |00ff" al|ink="#00|
|00000250| 66 66 30 30 22 3e 0a 0a | 3c 48 31 3e 3c 41 20 49 |ff00">..|<H1><A I|
|00000260| 44 3d 22 53 45 43 54 49 | 4f 4e 30 30 30 31 30 30 |D="SECTI|ON000100|
|00000270| 30 30 30 30 30 30 30 30 | 30 30 30 30 30 30 22 3e |00000000|000000">|
|00000280| 0a 42 75 69 6c 74 2d 69 | 6e 20 4d 6f 64 75 6c 65 |.Built-i|n Module|
|00000290| 20 6d 70 7a 3c 2f 41 3e | 0a 3c 2f 48 31 3e 0a 6d | mpz</A>|.</H1>.m|
|000002a0| 70 7a 0a 0a 3c 50 3e 0a | 54 68 69 73 20 69 73 20 |pz..<P>.|This is |
|000002b0| 61 6e 20 6f 70 74 69 6f | 6e 61 6c 20 6d 6f 64 75 |an optio|nal modu|
|000002c0| 6c 65 2e 20 20 49 74 20 | 69 73 20 6f 6e 6c 79 20 |le. It |is only |
|000002d0| 61 76 61 69 6c 61 62 6c | 65 20 77 68 65 6e 20 50 |availabl|e when P|
|000002e0| 79 74 68 6f 6e 20 69 73 | 0a 63 6f 6e 66 69 67 75 |ython is|.configu|
|000002f0| 72 65 64 20 74 6f 20 69 | 6e 63 6c 75 64 65 20 69 |red to i|nclude i|
|00000300| 74 2c 20 77 68 69 63 68 | 20 72 65 71 75 69 72 65 |t, which| require|
|00000310| 73 20 74 68 61 74 20 74 | 68 65 20 47 4e 55 20 4d |s that t|he GNU M|
|00000320| 50 20 73 6f 66 74 77 61 | 72 65 20 69 73 0a 69 6e |P softwa|re is.in|
|00000330| 73 74 61 6c 6c 65 64 2e | 0a 0a 3c 50 3e 0a 54 68 |stalled.|..<P>.Th|
|00000340| 69 73 20 6d 6f 64 75 6c | 65 20 69 6d 70 6c 65 6d |is modul|e implem|
|00000350| 65 6e 74 73 20 74 68 65 | 20 69 6e 74 65 72 66 61 |ents the| interfa|
|00000360| 63 65 20 74 6f 20 70 61 | 72 74 20 6f 66 20 74 68 |ce to pa|rt of th|
|00000370| 65 20 47 4e 55 20 4d 50 | 20 6c 69 62 72 61 72 79 |e GNU MP| library|
|00000380| 2c 0a 77 68 69 63 68 20 | 64 65 66 69 6e 65 73 20 |,.which |defines |
|00000390| 61 72 62 69 74 72 61 72 | 79 20 70 72 65 63 69 73 |arbitrar|y precis|
|000003a0| 69 6f 6e 20 69 6e 74 65 | 67 65 72 20 61 6e 64 20 |ion inte|ger and |
|000003b0| 72 61 74 69 6f 6e 61 6c | 20 6e 75 6d 62 65 72 0a |rational| number.|
|000003c0| 61 72 69 74 68 6d 65 74 | 69 63 20 72 6f 75 74 69 |arithmet|ic routi|
|000003d0| 6e 65 73 2e 20 20 4f 6e | 6c 79 20 74 68 65 20 69 |nes. On|ly the i|
|000003e0| 6e 74 65 72 66 61 63 65 | 73 20 74 6f 20 74 68 65 |nterface|s to the|
|000003f0| 20 3c 49 3e 69 6e 74 65 | 67 65 72 3c 2f 49 3e 0a | <I>inte|ger</I>.|
|00000400| 28 6d 70 7a 5f 2e 2e 2e | 29 20 72 6f 75 74 69 6e |(mpz_...|) routin|
|00000410| 65 73 20 61 72 65 20 70 | 72 6f 76 69 64 65 64 2e |es are p|rovided.|
|00000420| 20 49 66 20 6e 6f 74 20 | 73 74 61 74 65 64 0a 6f | If not |stated.o|
|00000430| 74 68 65 72 77 69 73 65 | 2c 20 74 68 65 20 64 65 |therwise|, the de|
|00000440| 73 63 72 69 70 74 69 6f | 6e 20 69 6e 20 74 68 65 |scriptio|n in the|
|00000450| 20 47 4e 55 20 4d 50 20 | 64 6f 63 75 6d 65 6e 74 | GNU MP |document|
|00000460| 61 74 69 6f 6e 20 63 61 | 6e 20 62 65 20 61 70 70 |ation ca|n be app|
|00000470| 6c 69 65 64 2e 0a 0a 3c | 50 3e 0a 49 6e 20 67 65 |lied...<|P>.In ge|
|00000480| 6e 65 72 61 6c 2c 20 6d | 70 7a 2d 6e 75 6d 62 65 |neral, m|pz-numbe|
|00000490| 72 73 20 63 61 6e 20 62 | 65 20 75 73 65 64 20 6a |rs can b|e used j|
|000004a0| 75 73 74 20 6c 69 6b 65 | 20 6f 74 68 65 72 20 73 |ust like| other s|
|000004b0| 74 61 6e 64 61 72 64 0a | 50 79 74 68 6f 6e 20 6e |tandard.|Python n|
|000004c0| 75 6d 62 65 72 73 2c 20 | 65 2e 67 2e 20 79 6f 75 |umbers, |e.g. you|
|000004d0| 20 63 61 6e 20 75 73 65 | 20 74 68 65 20 62 75 69 | can use| the bui|
|000004e0| 6c 74 2d 69 6e 20 6f 70 | 65 72 61 74 6f 72 73 20 |lt-in op|erators |
|000004f0| 6c 69 6b 65 20 2b 2c 0a | 2a 2c 20 65 74 63 2e 2c |like +,.|*, etc.,|
|00000500| 20 61 73 20 77 65 6c 6c | 20 61 73 20 74 68 65 20 | as well| as the |
|00000510| 73 74 61 6e 64 61 72 64 | 20 62 75 69 6c 74 2d 69 |standard| built-i|
|00000520| 6e 20 66 75 6e 63 74 69 | 6f 6e 73 20 6c 69 6b 65 |n functi|ons like|
|00000530| 0a 61 62 73 2c 20 69 6e | 74 2c 20 2e 2e 2e 2c 20 |.abs, in|t, ..., |
|00000540| 64 69 76 6d 6f 64 2c 20 | 70 6f 77 2e 0a 50 6c 65 |divmod, |pow..Ple|
|00000550| 61 73 65 20 6e 6f 74 65 | 3a 20 74 68 65 20 3c 49 |ase note|: the <I|
|00000560| 3e 62 69 74 77 69 73 65 | 2d 78 6f 72 3c 2f 49 3e |>bitwise|-xor</I>|
|00000570| 20 6f 70 65 72 61 74 69 | 6f 6e 20 68 61 73 20 62 | operati|on has b|
|00000580| 65 65 6e 20 69 6d 70 6c | 65 6d 65 6e 74 65 64 20 |een impl|emented |
|00000590| 61 73 0a 61 20 62 75 6e | 63 68 20 6f 66 20 3c 49 |as.a bun|ch of <I|
|000005a0| 3e 61 6e 64 3c 2f 49 3e | 73 2c 20 3c 49 3e 69 6e |>and</I>|s, <I>in|
|000005b0| 76 65 72 74 3c 2f 49 3e | 73 20 61 6e 64 20 3c 49 |vert</I>|s and <I|
|000005c0| 3e 6f 72 3c 2f 49 3e 73 | 2c 20 62 65 63 61 75 73 |>or</I>s|, becaus|
|000005d0| 65 20 74 68 65 20 6c 69 | 62 72 61 72 79 0a 6c 61 |e the li|brary.la|
|000005e0| 63 6b 73 20 61 6e 20 6d | 70 7a 5f 78 6f 72 20 66 |cks an m|pz_xor f|
|000005f0| 75 6e 63 74 69 6f 6e 2c | 20 61 6e 64 20 49 20 64 |unction,| and I d|
|00000600| 69 64 6e 27 74 20 6e 65 | 65 64 20 6f 6e 65 2e 0a |idn't ne|ed one..|
|00000610| 0a 3c 50 3e 0a 59 6f 75 | 20 63 72 65 61 74 65 20 |.<P>.You| create |
|00000620| 61 6e 20 6d 70 7a 2d 6e | 75 6d 62 65 72 20 62 79 |an mpz-n|umber by|
|00000630| 20 63 61 6c 6c 69 6e 67 | 20 74 68 65 20 66 75 6e | calling| the fun|
|00000640| 63 74 69 6f 6e 20 63 61 | 6c 6c 65 64 20 6d 70 7a |ction ca|lled mpz|
|00000650| 20 28 73 65 65 0a 62 65 | 6c 6f 77 20 66 6f 72 20 | (see.be|low for |
|00000660| 61 6e 20 65 78 61 63 74 | 20 64 65 73 63 72 69 70 |an exact| descrip|
|00000670| 74 69 6f 6e 29 2e 20 41 | 6e 20 6d 70 7a 2d 6e 75 |tion). A|n mpz-nu|
|00000680| 6d 62 65 72 20 69 73 20 | 70 72 69 6e 74 65 64 20 |mber is |printed |
|00000690| 6c 69 6b 65 20 74 68 69 | 73 3a 0a 6d 70 7a 28 76 |like thi|s:.mpz(v|
|000006a0| 61 6c 75 65 29 2e 0a 0a | 3c 50 3e 0a 0a 3c 42 52 |alue)...|<P>..<BR|
|000006b0| 3e 0a 3c 49 4d 47 0a 20 | 20 53 54 59 4c 45 3d 22 |>.<IMG. | STYLE="|
|000006c0| 68 65 69 67 68 74 3a 20 | 31 39 36 2e 32 35 65 78 |height: |196.25ex|
|000006d0| 3b 20 76 65 72 74 69 63 | 61 6c 2d 61 6c 69 67 6e |; vertic|al-align|
|000006e0| 3a 20 2d 30 2e 35 37 65 | 78 3b 20 22 20 53 52 43 |: -0.57e|x; " SRC|
|000006f0| 3d 22 69 6d 67 31 2e 70 | 6e 67 22 0a 20 41 4c 54 |="img1.p|ng". ALT|
|00000700| 3d 22 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |="\begin|{funcdes|
|00000710| 63 7d 7b 6d 70 7a 7d 7b | 76 61 6c 75 65 7d 0a 43 |c}{mpz}{|value}.C|
|00000720| 72 65 61 74 65 20 61 20 | 6e 65 77 20 6d 70 7a 2d |reate a |new mpz-|
|00000730| 6e 75 6d 62 65 72 2e 20 | 5c 76 61 72 7b 76 61 6c |number. |\var{val|
|00000740| 75 65 7d 20 63 61 6e 20 | 62 65 20 61 6e 20 69 6e |ue} can |be an in|
|00000750| 74 2e 2e 2e 0a 2e 2e 2e | 74 69 76 65 20 6e 75 6d |t.......|tive num|
|00000760| 62 65 72 2e 20 53 65 65 | 20 61 6c 73 6f 20 74 68 |ber. See| also th|
|00000770| 65 20 5c 63 6f 64 65 7b | 62 69 6e 61 72 79 7d 0a |e \code{|binary}.|
|00000780| 6d 65 74 68 6f 64 2c 20 | 64 65 73 63 72 69 62 65 |method, |describe|
|00000790| 64 20 62 65 6c 6f 77 2e | 0a 5c 65 6e 64 7b 66 75 |d below.|.\end{fu|
|000007a0| 6e 63 64 65 73 63 7d 22 | 3e 0a 3c 42 52 3e 0a 0a |ncdesc}"|>.<BR>..|
|000007b0| 3c 50 3e 0a 41 20 6e 75 | 6d 62 65 72 20 6f 66 20 |<P>.A nu|mber of |
|000007c0| 3c 45 4d 3e 65 78 74 72 | 61 3c 2f 45 4d 3e 20 66 |<EM>extr|a</EM> f|
|000007d0| 75 6e 63 74 69 6f 6e 73 | 20 61 72 65 20 64 65 66 |unctions| are def|
|000007e0| 69 6e 65 64 20 69 6e 20 | 74 68 69 73 20 6d 6f 64 |ined in |this mod|
|000007f0| 75 6c 65 2e 20 4e 6f 6e | 0a 6d 70 7a 2d 61 72 67 |ule. Non|.mpz-arg|
|00000800| 75 6d 65 6e 74 73 20 61 | 72 65 20 63 6f 6e 76 65 |uments a|re conve|
|00000810| 72 74 65 64 20 74 6f 20 | 6d 70 7a 2d 76 61 6c 75 |rted to |mpz-valu|
|00000820| 65 73 20 66 69 72 73 74 | 2c 20 61 6e 64 20 74 68 |es first|, and th|
|00000830| 65 20 66 75 6e 63 74 69 | 6f 6e 73 0a 72 65 74 75 |e functi|ons.retu|
|00000840| 72 6e 20 6d 70 7a 2d 6e | 75 6d 62 65 72 73 2e 0a |rn mpz-n|umbers..|
|00000850| 0a 3c 50 3e 0a 3c 42 52 | 3e 0a 3c 49 4d 47 0a 20 |.<P>.<BR|>.<IMG. |
|00000860| 20 53 54 59 4c 45 3d 22 | 68 65 69 67 68 74 3a 20 | STYLE="|height: |
|00000870| 32 2e 31 37 65 78 3b 20 | 76 65 72 74 69 63 61 6c |2.17ex; |vertical|
|00000880| 2d 61 6c 69 67 6e 3a 20 | 31 37 36 2e 35 35 65 78 |-align: |176.55ex|
|00000890| 3b 20 22 20 53 52 43 3d | 22 69 6d 67 32 2e 70 6e |; " SRC=|"img2.pn|
|000008a0| 67 22 0a 20 41 4c 54 3d | 22 5c 62 65 67 69 6e 7b |g". ALT=|"\begin{|
|000008b0| 66 75 6e 63 64 65 73 63 | 7d 7b 70 6f 77 6d 7d 7b |funcdesc|}{powm}{|
|000008c0| 62 61 73 65 5c 2c 20 65 | 78 70 6f 6e 65 6e 74 5c |base\, e|xponent\|
|000008d0| 2c 20 6d 6f 64 75 6c 75 | 73 7d 0a 52 65 74 75 72 |, modulu|s}.Retur|
|000008e0| 6e 20 5c 63 6f 64 65 7b | 70 6f 77 28 5c 76 61 72 |n \code{|pow(\var|
|000008f0| 7b 62 61 73 65 7d 2c 20 | 2e 2e 2e 0a 2e 2e 2e 20 |{base}, |....... |
|00000900| 5c 43 2d 6c 69 62 72 61 | 72 79 20 66 75 6e 63 74 |\C-libra|ry funct|
|00000910| 69 6f 6e 2c 20 74 68 69 | 73 20 76 65 72 73 69 6f |ion, thi|s versio|
|00000920| 6e 20 63 61 6e 20 68 61 | 6e 64 6c 65 20 6e 65 67 |n can ha|ndle neg|
|00000930| 61 74 69 76 65 20 65 78 | 70 6f 6e 65 6e 74 73 2e |ative ex|ponents.|
|00000940| 0a 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 22 |.\end{fu|ncdesc}"|
|00000950| 3e 0a 3c 42 52 3e 0a 0a | 3c 50 3e 0a 3c 42 52 3e |>.<BR>..|<P>.<BR>|
|00000960| 0a 3c 49 4d 47 0a 20 20 | 53 54 59 4c 45 3d 22 68 |.<IMG. |STYLE="h|
|00000970| 65 69 67 68 74 3a 20 32 | 2e 33 38 65 78 3b 20 76 |eight: 2|.38ex; v|
|00000980| 65 72 74 69 63 61 6c 2d | 61 6c 69 67 6e 3a 20 31 |ertical-|align: 1|
|00000990| 37 36 2e 34 30 65 78 3b | 20 22 20 53 52 43 3d 22 |76.40ex;| " SRC="|
|000009a0| 69 6d 67 33 2e 70 6e 67 | 22 0a 20 41 4c 54 3d 22 |img3.png|". ALT="|
|000009b0| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|000009c0| 7b 67 63 64 7d 7b 6f 70 | 31 5c 2c 20 6f 70 32 7d |{gcd}{op|1\, op2}|
|000009d0| 0a 52 65 74 75 72 6e 20 | 74 68 65 20 67 72 65 61 |.Return |the grea|
|000009e0| 74 65 73 74 20 63 6f 6d | 6d 6f 6e 20 64 69 76 69 |test com|mon divi|
|000009f0| 73 6f 72 20 6f 66 20 5c | 76 61 72 7b 6f 70 31 7d |sor of \|var{op1}|
|00000a00| 20 61 6e 64 20 5c 76 61 | 72 7b 6f 70 32 7d 2e 0a | and \va|r{op2}..|
|00000a10| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 22 3e |\end{fun|cdesc}">|
|00000a20| 0a 3c 42 52 3e 0a 0a 3c | 50 3e 0a 3c 42 52 3e 0a |.<BR>..<|P>.<BR>.|
|00000a30| 3c 49 4d 47 0a 20 20 53 | 54 59 4c 45 3d 22 68 65 |<IMG. S|TYLE="he|
|00000a40| 69 67 68 74 3a 20 32 2e | 31 37 65 78 3b 20 76 65 |ight: 2.|17ex; ve|
|00000a50| 72 74 69 63 61 6c 2d 61 | 6c 69 67 6e 3a 20 31 37 |rtical-a|lign: 17|
|00000a60| 36 2e 35 35 65 78 3b 20 | 22 20 53 52 43 3d 22 69 |6.55ex; |" SRC="i|
|00000a70| 6d 67 34 2e 70 6e 67 22 | 0a 20 41 4c 54 3d 22 5c |mg4.png"|. ALT="\|
|00000a80| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00000a90| 67 63 64 65 78 74 7d 7b | 61 5c 2c 20 62 7d 0a 52 |gcdext}{|a\, b}.R|
|00000aa0| 65 74 75 72 6e 20 61 20 | 74 75 70 6c 65 20 5c 63 |eturn a |tuple \c|
|00000ab0| 6f 64 65 7b 28 5c 76 61 | 72 7b 67 7d 2c 20 5c 76 |ode{(\va|r{g}, \v|
|00000ac0| 61 72 7b 73 7d 2c 20 5c | 76 61 72 7b 74 7d 2e 2e |ar{s}, \|var{t}..|
|00000ad0| 2e 0a 2e 2e 2e 7d 2a 5c | 76 61 72 7b 73 7d 20 2b |.....}*\|var{s} +|
|00000ae0| 20 5c 76 61 72 7b 62 7d | 2a 5c 76 61 72 7b 74 7d | \var{b}|*\var{t}|
|00000af0| 20 3d 3d 20 5c 76 61 72 | 7b 67 7d 20 3d 3d 20 67 | == \var|{g} == g|
|00000b00| 63 64 28 5c 76 61 72 7b | 61 7d 2c 20 5c 76 61 72 |cd(\var{|a}, \var|
|00000b10| 7b 62 7d 29 7d 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 |{b})}..\|end{func|
|00000b20| 64 65 73 63 7d 22 3e 0a | 3c 42 52 3e 0a 0a 3c 50 |desc}">.|<BR>..<P|
|00000b30| 3e 0a 3c 42 52 3e 0a 3c | 49 4d 47 0a 20 20 53 54 |>.<BR>.<|IMG. ST|
|00000b40| 59 4c 45 3d 22 68 65 69 | 67 68 74 3a 20 32 2e 33 |YLE="hei|ght: 2.3|
|00000b50| 38 65 78 3b 20 76 65 72 | 74 69 63 61 6c 2d 61 6c |8ex; ver|tical-al|
|00000b60| 69 67 6e 3a 20 31 37 36 | 2e 34 30 65 78 3b 20 22 |ign: 176|.40ex; "|
|00000b70| 20 53 52 43 3d 22 69 6d | 67 35 2e 70 6e 67 22 0a | SRC="im|g5.png".|
|00000b80| 20 41 4c 54 3d 22 5c 62 | 65 67 69 6e 7b 66 75 6e | ALT="\b|egin{fun|
|00000b90| 63 64 65 73 63 7d 7b 73 | 71 72 74 7d 7b 6f 70 7d |cdesc}{s|qrt}{op}|
|00000ba0| 0a 52 65 74 75 72 6e 20 | 74 68 65 20 73 71 75 61 |.Return |the squa|
|00000bb0| 72 65 20 72 6f 6f 74 20 | 6f 66 20 5c 76 61 72 7b |re root |of \var{|
|00000bc0| 6f 70 7d 2e 20 54 68 65 | 20 72 65 73 75 6c 74 20 |op}. The| result |
|00000bd0| 69 73 20 72 6f 75 6e 64 | 65 64 20 74 6f 77 61 72 |is round|ed towar|
|00000be0| 64 73 20 7a 65 72 6f 2e | 0a 5c 65 6e 64 7b 66 75 |ds zero.|.\end{fu|
|00000bf0| 6e 63 64 65 73 63 7d 22 | 3e 0a 3c 42 52 3e 0a 0a |ncdesc}"|>.<BR>..|
|00000c00| 3c 50 3e 0a 3c 42 52 3e | 0a 3c 49 4d 47 0a 20 20 |<P>.<BR>|.<IMG. |
|00000c10| 53 54 59 4c 45 3d 22 68 | 65 69 67 68 74 3a 20 32 |STYLE="h|eight: 2|
|00000c20| 2e 31 37 65 78 3b 20 76 | 65 72 74 69 63 61 6c 2d |.17ex; v|ertical-|
|00000c30| 61 6c 69 67 6e 3a 20 31 | 37 36 2e 35 35 65 78 3b |align: 1|76.55ex;|
|00000c40| 20 22 20 53 52 43 3d 22 | 69 6d 67 36 2e 70 6e 67 | " SRC="|img6.png|
|00000c50| 22 0a 20 41 4c 54 3d 22 | 5c 62 65 67 69 6e 7b 66 |". ALT="|\begin{f|
|00000c60| 75 6e 63 64 65 73 63 7d | 7b 73 71 72 74 72 65 6d |uncdesc}|{sqrtrem|
|00000c70| 7d 7b 6f 70 7d 0a 52 65 | 74 75 72 6e 20 61 20 74 |}{op}.Re|turn a t|
|00000c80| 75 70 6c 65 20 5c 63 6f | 64 65 7b 28 5c 76 61 72 |uple \co|de{(\var|
|00000c90| 7b 72 6f 6f 74 7d 2c 20 | 5c 76 61 72 7b 72 65 6d |{root}, |\var{rem|
|00000ca0| 61 69 6e 64 65 72 7d 2e | 2e 2e 0a 2e 2e 2e 74 68 |ainder}.|......th|
|00000cb0| 61 74 0a 5c 63 6f 64 65 | 7b 5c 76 61 72 7b 72 6f |at.\code|{\var{ro|
|00000cc0| 6f 74 7d 2a 5c 76 61 72 | 7b 72 6f 6f 74 7d 20 2b |ot}*\var|{root} +|
|00000cd0| 20 5c 76 61 72 7b 72 65 | 6d 61 69 6e 64 65 72 7d | \var{re|mainder}|
|00000ce0| 20 3d 3d 20 5c 76 61 72 | 7b 6f 70 7d 7d 2e 0a 5c | == \var|{op}}..\|
|00000cf0| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 22 3e 0a |end{func|desc}">.|
|00000d00| 3c 42 52 3e 0a 0a 3c 50 | 3e 0a 3c 42 52 3e 0a 3c |<BR>..<P|>.<BR>.<|
|00000d10| 49 4d 47 0a 20 20 53 54 | 59 4c 45 3d 22 68 65 69 |IMG. ST|YLE="hei|
|00000d20| 67 68 74 3a 20 32 2e 33 | 38 65 78 3b 20 76 65 72 |ght: 2.3|8ex; ver|
|00000d30| 74 69 63 61 6c 2d 61 6c | 69 67 6e 3a 20 31 37 36 |tical-al|ign: 176|
|00000d40| 2e 34 30 65 78 3b 20 22 | 20 53 52 43 3d 22 69 6d |.40ex; "| SRC="im|
|00000d50| 67 37 2e 70 6e 67 22 0a | 20 41 4c 54 3d 22 5c 62 |g7.png".| ALT="\b|
|00000d60| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 64 |egin{fun|cdesc}{d|
|00000d70| 69 76 6d 7d 7b 6e 75 6d | 65 72 61 74 6f 72 5c 2c |ivm}{num|erator\,|
|00000d80| 20 64 65 6e 6f 6d 69 6e | 61 74 6f 72 5c 2c 20 6d | denomin|ator\, m|
|00000d90| 6f 64 75 6c 75 73 7d 0a | 52 65 74 75 72 6e 73 20 |odulus}.|Returns |
|00000da0| 61 20 6e 75 6d 62 65 72 | 20 5c 76 61 72 2e 2e 2e |a number| \var...|
|00000db0| 0a 2e 2e 2e 6f 75 6c 64 | 20 61 6c 73 6f 20 69 6d |....ould| also im|
|00000dc0| 70 6c 65 6d 65 6e 74 20 | 74 68 69 73 20 66 75 6e |plement |this fun|
|00000dd0| 63 74 69 6f 6e 20 69 6e | 20 50 79 74 68 6f 6e 2c |ction in| Python,|
|00000de0| 20 75 73 69 6e 67 20 5c | 63 6f 64 65 7b 67 63 64 | using \|code{gcd|
|00000df0| 65 78 74 7d 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |ext}..\e|nd{funcd|
|00000e00| 65 73 63 7d 22 3e 0a 3c | 42 52 3e 0a 0a 3c 50 3e |esc}">.<|BR>..<P>|
|00000e10| 0a 41 6e 20 6d 70 7a 2d | 6e 75 6d 62 65 72 20 68 |.An mpz-|number h|
|00000e20| 61 73 20 6f 6e 65 20 6d | 65 74 68 6f 64 3a 0a 0a |as one m|ethod:..|
|00000e30| 3c 50 3e 0a 0a 3c 42 52 | 3e 0a 3c 49 4d 47 0a 20 |<P>..<BR|>.<IMG. |
|00000e40| 20 53 54 59 4c 45 3d 22 | 68 65 69 67 68 74 3a 20 | STYLE="|height: |
|00000e50| 32 2e 32 34 65 78 3b 20 | 76 65 72 74 69 63 61 6c |2.24ex; |vertical|
|00000e60| 2d 61 6c 69 67 6e 3a 20 | 31 37 36 2e 35 34 65 78 |-align: |176.54ex|
|00000e70| 3b 20 22 20 53 52 43 3d | 22 69 6d 67 38 2e 70 6e |; " SRC=|"img8.pn|
|00000e80| 67 22 0a 20 41 4c 54 3d | 22 5c 62 65 67 69 6e 7b |g". ALT=|"\begin{|
|00000e90| 66 75 6e 63 64 65 73 63 | 7d 7b 62 69 6e 61 72 79 |funcdesc|}{binary|
|00000ea0| 7d 7b 7d 0a 43 6f 6e 76 | 65 72 74 20 74 68 69 73 |}{}.Conv|ert this|
|00000eb0| 20 6d 70 7a 2d 6e 75 6d | 62 65 72 20 74 6f 20 61 | mpz-num|ber to a|
|00000ec0| 20 62 69 6e 61 72 79 20 | 73 74 72 69 6e 67 2c 20 | binary |string, |
|00000ed0| 77 68 65 72 65 20 74 68 | 2e 2e 2e 0a 2e 2e 2e 74 |where th|.......t|
|00000ee0| 6f 20 7a 65 72 6f 2c 0a | 6f 74 68 65 72 77 69 73 |o zero,.|otherwis|
|00000ef0| 65 20 61 20 5c 63 6f 64 | 65 7b 56 61 6c 75 65 45 |e a \cod|e{ValueE|
|00000f00| 72 72 6f 72 7d 2d 65 78 | 63 65 70 74 69 6f 6e 20 |rror}-ex|ception |
|00000f10| 77 69 6c 6c 20 62 65 20 | 72 61 69 73 65 64 2e 0a |will be |raised..|
|00000f20| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 22 3e |\end{fun|cdesc}">|
|00000f30| 0a 3c 42 52 3e 0a 3c 48 | 52 3e 0a 0a 3c 2f 42 4f |.<BR>.<H|R>..</BO|
|00000f40| 44 59 3e 0a 3c 2f 48 54 | 4d 4c 3e 0a |DY>.</HT|ML>. |
+--------+-------------------------+-------------------------+--------+--------+