grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026+ ЀpÇw„)ãó¾€Rt^RIt^RIt^RItRRRR/Rlt]P !4P4t]P]n ]P]n ]P]n^]P]P &RtRtRt]P+R 4t^R IHt]!]4tAR ^/R ltR tRtRtRtRt Rt!Rt"Rt#Rt$R# ]dRtLËi;i)aþPython implementations of some algorithms for use by longobject.c. The goal is to provide asymptotically faster algorithms that can be used for operations on integers with many digits. In those cases, the performance overhead of the Python implementation is not significant since the asymptotic behavior is what dominates runtime. Functions provided by this module should be considered private and not part of any public API. Note: for ease of maintainability, please prefer clear code and avoid "micro-optimizations". This module will only be imported and used for integers with a huge number of digits. Saving a few microseconds with tricky or non-obvious code is not worth it. For people looking for maximum performance, they should use something like gmpy2.NÚneed_hiFÚshowcóL€\4p\4pV0pV'd�VP4pW9gW8:dK&VPV4V^, pW, p V'dT MTp VPV 4VPV 4W‰8wgK~VPW , 4K—VP4p \4p V 'dj\ V 4pV P V4V^, pW‚8”gK5V^, V 9gKEW‹9gKMV PV4V PV4KqV'g V 'dQh/p \ Wl,4F÷pV^, pWè, p V^, V 9d-V'd\RRR7WÞ^, ,V,pMˆW�9dfV'd\RRR7WØ,WØ,,pW˜8wd5V'd\RRR7^V,^,V8XgQhWñ,pMV'd\RRR7W,pV'd\RYîV9dRMR 4WýV&Kù WmP48:gQhV P4V, ;p'dV'gQhVFpWÞK V #) éz* baseÚ)ÚendÚsquarez * baseÚpowz atÚneededÚextra) ÚsetÚpopÚaddÚcopyÚmaxÚremoveÚsortedÚprintÚkeys)ÚwÚbaseÚ more_thanrrÚseenÚneedÚwsÚloÚhiÚwhichÚcandsr ÚdÚnÚresultÚexcesss&&&$$ Ú./opt/alt/python314/lib64/python3.14/_pylong.pyÚcompute_powersr$9s÷€Ü ‹5€DÜ ‹5€DØ ˆ€Bß Ø �F‰F‹HˆØ Œ9˜œÙ Ø �‰�Œ Ø �!�VˆØ �Vˆç‘ 2ˆØ �‰�ŒØ �‰ˆuŒ Ø Ž8Ø �F‰F�1•9Ö ð �I‰I‹K€EÜ ‹E€Eß Ü �‹JˆØ � ‰ �QŒØ �!�VˆØ Ž>˜a �c¨Ö.°2¶?Ø �I‰I�bŒMØ �I‰I�bŽMß Ÿ%ÐÐ à €AÜ �D•LÖ !ˆØ �!�VˆØ �VˆØ ˆQ�3�!Œ8ßÜ�h BÕ'ؘ•s•V˜d•]‰FØ ŒW÷Ü�h BÕ'Ø•U˜Q�U•]ˆFØŒxßܘ)¨Õ,ؘ2•v •z Q”Ð&�Ø•�øçÜ�e Õ$Ø•YˆFß Ü �%˜¨T¬ ™H°wÔ ?؈!‹ñ1"ð4 —6‘6“8Ô ÐÐ Ø—‘“˜D•Ð €vÖ ßˆˆwÛˆAØ’ñà €Hócó8aaaa€^RIHo^ÈoVVVV3Rlo\P!\4;_uu_4VP 4p\ VS!^4S4oV^8dRpV)pMRpS!W4pV'dV)pRRR4V# +'giX#;i)z6Asymptotically fast conversion of an 'int' to Decimal.)ÚDecimalcóÆ<€VS8:d S!V4#V^, pW, pV^V,^, ,pS!WB4S!W1V, 4SV,,,#©r©) r rÚw2rrÚBITLIMÚDÚinnerÚw2pows && €€€€r#r.Úint_to_decimal..inner�sVø€Ø �Œ;Ù�Q“4ˆKØ �!�VˆØ �WˆØ �1˜•7˜a•-Õ ˆÙ�R‹}™u R¨R­Ó0°5¸µ9Õ<Õ<Ð.innerÁsQø€Ø �Œ;Ü�q“6ˆMØ �!�VˆÜ˜˜5 �9Ó%‰ˆÙ�R˜R�Ó ¡5¨£=×#6Ñ#6°rÓ#:Õ:Ð:r%gÿyŸPDÓ?Ú-rÚ0)r4Ú_decimalr:r7Úintr$ÚitemsÚlstrip) r rÚkÚvÚsignÚsr=r.r>s & @@@r#Úint_to_decimal_stringrJ²s¾ú€à � ‰ ‹€A؈7„{”xÒ+ô”> !Ó$Ó%Ð%ð€F÷;ô ˆAÐ"Õ " QÕ &Ó'€AÜ ˜1˜a Ó (€EØ— ‘ – ‰ˆØ•6ˆˆa‹ñàˆ1„uØ ˆBˆØ‰àˆÙ ˆa‹ €A؈…tˆs„{—qð �H‰H�S‹MˆØ �8€Or%cópaaaa€RoVVVV3Rlo\\S4^S4oS!^\S44#)z6Asymptotically fast conversion of a 'str' to an 'int'.icóÐ<€W, S8:d\SW4#W,^,^, pS!W!4S!W4SW, ,,W, ,,#r))rC)ÚaÚbÚmidr=r.rIÚw5pows&& €€€€r#r.Ú _str_to_int_inner..innerîsWø€Ø �5�FŒ?Ü�q˜�v“;Ð Ø�u�q�y˜QÕˆÙ�c“ Ù˜!“M E¨!­'¥NÕ2Ø�õ!õ"ð #r%)r$Úlen)rIr=r.rPsf@@@r#Ú_str_to_int_innerrSßs9û€ð€F÷#ð#ô œ3˜q›6 1 fÓ -€EÙ �”C˜“FÓ Ðr%z0x1.a934f0979a371p-2)Ú defaultdictÚGUARDc óxaa a a aa€Ro \Pp\4oS^8”gQhV VV V VV3Rlo VP4pV\,p\ V4pV^,WE, R8„,pVP 4^.8¼d\RV R24h\P!\4;_uu_4o V!R4p\WgS RR7o\V^V, S RR7p^S P\P&\PS nSP4F6wršV P!4S,^,S nW¨V ,53SV &K8 ?\P$S nS !V!V4V4RRR4\ P'S4# +'giL%;i) i †có‚<€VS 8:d5SP\\V44PV44R#V^, pW, pST,wrg\ TP 4TP 4, ^4S ,S nT5T5,p\PS nTP4pYT,, pT^8¼gQh^pYV8¼d1^pYV,pT^, pYV8¼dRp\ YV4wr•YI, p\T;;,^, uu&S !YB4?S !YS4R#)Niç) ÚextendrCr:Úto_bytesr;rÚadjustedÚprecr1ÚMAX_PRECÚto_integral_valueÚ_spread)r rÚw1r+rrÚp256ÚrecipÚcountÚhi2ÚBYTELIMrUÚctxr.Úpow256r!s&& €€€€€€r#r.Ú$_dec_str_to_int_inner..innersø€à �Œ<ð �M‰Mœ#œc !›f›+×.Ñ.¨qÓ1Ô 2Ù Ø �!�VˆØ �VˆØ ð! �*‰KˆDô ˜1Ÿ:™:›<¨$¯-©-«/Õ9¸1Ó=ÀÕEˆCŒHØ��u�f•ˆBÜ×'Ñ'ˆCŒHØ×%Ñ%Ó'ˆBؘ$•Y•ˆBð˜”7ˆN�7ðˆEØŒzØ�Ø• �Ø�a•�Ø”:ð  �EÜ$ RÓ.‘G�CØ•I�BÜ �E�N˜aÕ ‹Nñ ˆbŒ Ø Ù ˆbŽ r%gÍÌÌÌÌÌì?zcannot convert string of len z to intéT)rN)r1r'Ú bytearrayÚ__len__Ú_LOG_10_BASE_256rCr4Ú ValueErrorr2r3r$ÚtrapsÚInexactÚ ROUND_DOWNÚroundingrDrZr[r\Ú from_bytes)rIrUr-ÚlenSÚlog_ubÚ log_ub_as_intrÚD256Úrpow256rFrGrdrer.rfr!s&d @@@@@r#Ú_dec_str_to_int_innerrwshý€ð €GÜ�‰€AÜ ‹[€Fà �1Œ9Ј9÷7ò7ðL �9‰9‹;€DØ Ô$Õ $€Fܘ“K€Mؘ՘VÕ3°cÑ9Õ:€Að  ‡|�|ƒ~˜ÔäÐ8¸¸¸gÐFÓGÐGÜ × Ò Ô4× 5Ô 5¸Ù�‹vˆÜ ¨¸$Ô?ˆÜ   A¨¥H¨g¸tÔDˆð &'ˆ� ‰ ”'—/‘/Ñ"Ü×)Ñ)ˆŒ Ø—L‘L–N‰DˆAð —z‘z“| eÕ+¨aÕ/ˆCŒHà A�J˜;˜ˆF�1‹Iñ#ð Ü×#Ñ#ˆŒÙ ‰a�‹d�AŒ÷- 6ô. �>‰>˜&Ó !Ð!÷/ 6× 5ús Â>CF)Æ) F9 cóš€VP4PRR4p\p\V4R8¼d\e\ pV!V4#)zkAsymptotically fast version of PyLong_FromString(), conversion of a string of decimal digits into an 'int'.Ú_ri€„)ÚrstripÚreplacerSrRrBrw)rIÚfuncs& r#Úint_from_stringr}…s@€ð �‰‹ ×ј3 Ó#€AÜ €DÜ ˆ1ƒv�ÔœxÒ3Ü$ˆÙ �‹7€Nr%cóÀ€\P!RV4pV'g \R4h\VP ^44pVP ^4R8XdV)pV#)zBAsymptotically fast version of decimal string to 'int' conversion.z\s*([+-]?)([0-9_]+)\s*z&invalid literal for int() with base 10r@)ÚreÚmatchrlr}Úgroup)rIÚmrGs& r#Ú str_to_intrƒ’sR€ô �ŠÐ*¨AÓ.€Aß ÜÐAÓBÐBܘŸ™ › Ó#€A؇w�wˆqƒz�SÔØ ˆBˆØ €Hr%i có¶€VP4V, \8:d \W4#V^,pV'dV^,pV^,pV^, pV^, p^V,^, pW, W,rv\W, W, V,WWt4wr‰\W�V,WWt4wr©V'd V ^,p W„,V ,V 3#)a2Divide a 2n-bit nonnegative integer a by an n-bit positive integer b, using a recursive divide-and-conquer algorithm. Inputs: n is a positive integer b is a positive integer with exactly n bits a is a nonnegative integer such that a < 2**n * b Output: (q, r) such that a = b*q+r and 0 <= r < b. )r4Ú _DIV_LIMITr;Ú_div3n2n) rMrNr ÚpadÚhalf_nÚmaskÚb1Úb2Úq1ÚrÚq2s &&& r#Ú_div2n1nr�¦s·€ð ‡|�|ƒ~˜ÕœZÔ'Ü�a‹|ÐØ ˆa�%€Cß Ø ˆa�ˆØ ˆa�ˆØ ˆQ�ˆØ �!�V€FØ ��K˜1Õ €DØ �[˜!�(ˆÜ �Q•V˜a�k¨TÕ1°1¸"Ó E�E€BÜ �Q˜D� !¨Ó 4�E€Bß Ø ˆa�ˆØ �<˜"Õ ˜aÐ Ðr%cóö€W, V8Xd'^V,^, WV,, V,rvM\WV4wrgWu,V,Wd,, pV^8dV^,pWr, pKWg3#)zAHelper function for _div2n1n; not intended to be called directly.)r�)Úa12Úa3rNrŠr‹r Úqr�s&&&&&& r#r†r†Äsc€à …x�2„~Ø�Q•˜!�|˜S¨!¥G�_¨rÕ1‰1䘠Ó#‰ˆØ ��"�˜�Õ€AØ ˆaŒ%Ø ˆQ�ˆØ �ŠØ ˆ4€Kr%có¬aaa€^.VP4S,^, S,,oVVV3RloV'dS!V^\S44S#)a2Decompose non-negative int a into base 2**n Input: a is a non-negative integer Output: List of the digits of a in base 2**n in little-endian order, meaning the most significant digit is last. The most significant digit is guaranteed to be non-zero. If a is 0 then the output is an empty list. cóÀ<€V^,V8XdVSV&R#W,^, pW1, S ,pW, pWV,, pS!WaV4S!WSV4R#)rNr*) ÚxÚLÚRrOÚshiftÚupperÚlowerÚa_digitsr.r s &&& €€€r#r.Ú_int2digits..inneràsWø€Ø ˆq�5�AŒ:؈H�Q‰KÙ Ø�u˜�lˆØ•˜A• ˆØ• ˆØ˜e•^Õ$ˆÙ ˆe˜ÔÙ ˆe˜!Ör%)r4rR)rMr rœr.s&f@@r#Ú _int2digitsržÑsEú€ðˆs�q—|‘|“~¨Õ)¨AÕ-°!Õ3Õ4€H÷ ÷ Ù ˆa�”C˜“MÔ"Ø €Or%cóPaaa€VVV3RloS'dS!^\S44#^#)zxCombine base-2**n digits into an int. This function is the inverse of `_int2digits`. For more details, see _int2digits. có¦<€V^,V8Xd SV,#W,^, pW , S,pS!W!4V,S!W4,#r)r*)r—r˜rOr™Údigitsr.r s&& €€€r#r.Ú_digits2int..innerõsFø€Ø ˆq�5�AŒ:ؘ!•9Ð Ø�u˜�lˆØ•˜A• ˆÙ�c“  Õ&©%°«-Õ7Ð7r%)rR)r¡r r.sff@r#Ú _digits2intr£ðs"ú€÷ 8÷%+‰5�”C˜“KÓ Ð1°Ð1r%cóø€VP4p\W4p^p.p\V4F/p\WB,V,W4wrtVP V4K1 VP 4\ WR4pW„3#)zWDivide a non-negative integer a by a positive integer b, giving quotient and remainder.)r4ržÚreversedr�ÚappendÚreverser£) rMrNr rœr�Úq_digitsÚa_digitÚq_digitr“s && r#Ú _divmod_posr«ÿsr€ð � ‰ ‹€Aܘ1Ó €Hà €AØ€HܘHÖ%ˆÜ˜q�v¨Õ0°!Ó7‰ ˆØ�‰˜Ö ñ&ð ×ÑÔÜ�HÓ €AØ ˆ4€Kr%có¶€V^8Xd \R4hV^8d\V)V)4wr#W#)3#V^8d\V(V4wr#V(W(,3#\W4#)zyAsymptotically fast replacement for divmod, for 'int'. Its time complexity is O(n**1.58), where n = #bits(a) + #bits(b). zdivision by zero)ÚZeroDivisionErrorÚ int_divmodr«)rMrNr“r�s&& r#r®r®sk€ð ˆA„vÜÐ 2Ó3Ð3Ø ˆQŒÜ˜1˜"˜q˜bÓ!‰ˆØ�"ˆuˆ Ø ˆQŒÜ˜1˜"˜aÓ ‰ˆØˆr�1�r•6ˆzÐä˜1Ó Ð r%),Ú__doc__rr1rBÚ ImportErrorr$Ú getcontextrr3r\r[ÚMAX_EMAXÚEmaxÚMIN_EMINÚEminrmrnr7rJrSÚfloatÚfromhexrkÚ collectionsrTrCr^rwr}rƒr…r�r†ržr£r«r®ÚconsumerÚ itertoolsÚchainrÚlimitÚrangerr*r%r#Úr¾sðñ >ó ÛðÛðNJ °%ðJ ¸eôJ ðX!×+Ò+Ó-×2Ñ2Ó4ÐØ%×.Ñ.ÐÔØ%×.Ñ.ÐÔØ%×.Ñ.ÐÔØ01Ð×јWŸ_™_Ñ-ò%òN+òZðJ—=‘=Ð!7Ó8Ðõ$Ù �cÓ €Øðt" aôt"òl ò  ð"€ ò ò< òò> 2òò" !ñbøð]ôØ‚HðúsŒCà CÃC