Jz`fcs(SSKJr SSKrSSKrSSKrSSKrSSKrSSKrS/r\RRr \RRr \R"SS9S5r\R "S\R"\R$-5rS SjrS r\R "S \R,\R"-5R.r\R "S \R,\R"-5R.r"S S\R45rg)DecimalNFractioni@)Zmaxsizecs[US[5n[[[U55U-5nUS:aUOU*nUS:XaS$U$![a [ nN'f=f)Nir)Zpow_PyHASH_MODULUSZhashabs ValueError _PyHASH_INF) numerator denominatorZdinvZhash_Zresults "/usr/lib64/python3.13/fractions.py_hash_algorithmr se2;O4(T#i.)D011nU5&F22)6)+ sAAAa \A\s* # optional whitespace at the start, (?P[-+]?) # an optional sign, then (?=\d|\.\d) # lookahead for digit or .digit (?P\d*|\d+(_\d+)*) # numerator (possibly empty) (?: # followed by (?:\s*/\s*(?P\d+(_\d+)*))? # an optional denominator | # or (?:\.(?P\d*|\d+(_\d+)*))? # an optional fractional part (?:E(?P[-+]?\d+(_\d+)*))? # and optional exponent ) \s*\Z # and optional whitespace to finish csUS:a USU--nO USU*--n[XS- -U5upEUS:XaUS-S:XaUS-nU(aUS:OUS:nU[U54$)Nr r)divmodr)ndexponent no_neg_zeroZqZrsigns r _round_to_exponentrJsx1} R\ R(] !Av, "DAAv!a%1* R1q5QUD Q<csUS:XaSSSU- 4$[[U55[U5pC[U5[U5- XC:*-nXR- n[XU5upx[[U55US-:Xa US-nUS- nXxU4$)NrFrr )strrlenr) rrfiguresZstr_nZstr_dmrr significands r _round_to_figuresrgs" AvaW$$s1v;A5 E SZ5>2A{H*1:D 3{ ! + A  h &&ray (?: (?P.)? (?P[<>=^]) )? (?P[-+ ]?) # Alt flag forces a slash and denominator in the output, even for # integer-valued Fraction objects. (?P\#)? # We don't implement the zeropad flag since there's no single obvious way # to interpret it. (?P0|[1-9][0-9]*)? (?P[,_])? a (?: (?P.)? (?P[<>=^]) )? (?P[-+ ]?) (?Pz)? (?P\#)? # A '0' that's *not* followed by another digit is parsed as a minimum width # rather than a zeropad flag. (?P0(?=[0-9]))? (?P0|[1-9][0-9]*)? (?P[,_])? (?:\.(?P0|[1-9][0-9]*))? (?P[eEfFgG%]) cs^\rSrSrSrS0U4Sjjr\S5r\S5r\U4Sj5r Sr Sr S1S jr \ S 5r\ S 5rS rS rSrSrSrS2SjrSr\"\\R05urrSr\"\\R85urrSr\"\\R@5ur!r"Sr#\"\#\RH5ur%r&Sr'\"\'\RPS5ur)r*Sr+\"\+\,S5ur-r.Sr/\"\/\R`S5ur1r2Sr3Sr4Sr5Sr6Sr7\Rp4Sjr9S r:S!r;S"rS%r?S&r@S'rAS(rBS)rCS*rDS+rES,rFS-rGS.rHS/rIU=rJ$)4ri _numerator _denominatorcs>[[U] U5nUGc[U5[LaXlSUlU$[U[R5(a$URUlURUlU$[U[[45(aUR5uUlUlU$[U[5(Ga[ R#U5nUc[%SU-5e[ UR'S5=(d S5nUR'S5nU(a [ U5nOSnUR'S5nU(a4UR)SS5nS [+U5-nX-[ U5-nX'-nUR'S 5nU(a#[ U5nUS :a US U--nO US U*--nUR'S 5S :XaU*nO[-S5e[U5[s=La[U5LaO OO{[U[R5(aQ[U[R5(a2URUR-URUR-p!O [-S5eUS :Xa[/SU-5e[0R2"X5n US :aU *n X-nX)-nXlX#lU$)Nrz Invalid literal for Fraction: %rZnum0denomdecimalZ_r exprr-z2argument should be a string or a Rational instancez+both arguments should be Rational instancesFraction(%s, 0))superr__new__typeintrr isinstancenumbersRationalr r floatras_integer_ratior_RATIONAL_FORMATmatchrZgroupZreplacer TypeErrorZeroDivisionErrormathgcd) clsr r selfrr!r"Zscaler$g __class__s r r(ZFraction.__new__s>Xs+C0  I#%"+$%! Iw'7'788"+"5"5$-$9$9! Iw'7885>5O5O5Q2!2 Is++$**959$%G%.&/00 5#6 ("%e*K"#Kggi0G")//#r": "CL 0$-$5G $D #, ''%.C!#h!8%S0I'2t83K776?c)!* I !9::)_ 8tK'8 8 G$4$455 {G$4$4 5 5##k&=&==%% (=(==# 12 2 ! #$5 $AB B HHY , ?A  #' rc s[U[R5(aU"U5$[U[5(d4[ UR <SU<S[ U5R <S35eUR"UR56$)Nz%.from_float() only takes floats, not  ()) r+r,Integralr.r2__name__r)_from_coprime_intsr/)r6Zf r from_floatZFraction.from_float4sq a)) * *q6MAu%% \\1d1g.>.>@A A%%q'9'9';<r/)r6Zdecr r from_decimalZFraction.from_decimalBsv $ c7++ , ,#c(#CC))sDI$6$689 9%%s';';'=>>rcsF>[[U] U5nXlX#lU$N)r'rr(rr)r6r r Zobjr9s r r>ZFraction._from_coprime_intsNs&Hc*3/"& rcs URS:H$Nrrr7 r is_integerZFraction.is_integerZs  A%%rcs2URUR4$rCrrFrGr r/ZFraction.as_integer_ratio^s !2!233rcsUS:a [S5eURU::a [U5$Sup#pEURURpvXg-nX8U--n X:aOXEX(U--U 4up#pEXvX-- pvM'X- U-n SU-X:U---UR::a[R XE5$[R X*U--X:U--5$)Nrz$max_denominator should be at least 1)rrrr)rrrrr>) r7Zmax_denominatorZp0Zq0Zp1Zq1rraZq2Zks r limit_denominatorZFraction.limit_denominatores@ Q CD D    /D> !# 1 11AbDB#R"Wb0NBBeq  " $ Q3R4=D-- -..r6 6..rB$wR4@ @rcUR$rC)rrJrGr r ZFraction.numerators ||rcrLrCrErMrGr r ZFraction.denominators ~~rcsnURR<SUR<SUR<S3$)NZ(z, r;)r9r=rrrFrGr __repr__ZFraction.__repr__s*#~~66#0A0AC CrcsURS:Xa[UR5$UR<SUR<3$)Nr/)rrrrFrGr __str__ZFraction.__str__s4    !t' '"oot/@/@A Arcs"US=(d SnUS=(d SnUSS:XaSOUSn[US5n[US =(d S 5nUS =(d SnURURpU S :dU(a[ U5US X3n O[ U5Un US:aSOUn X&[ U 5- [ U 5- -n US:XaX-U -$US:XaX-U -$US:Xa[ U 5S-n U SU U -U -XS-$X-U -$)Nfill align>rr%r#alt minimumwidthr thousands_seprrOr<^rI)boolr*rrrr)r7r1rQrSpos_signalternate_formrVrWrrbodyrpaddinghalfs r _format_generalZFraction._format_generalsAV}#g%#v#-25=eEl+507C8 o.4"  1 11 q5N!fm_-Qq.ABD!fm_-D!esT2SY>? C<>D( ( c\;( ( c\w<1$D5D>D(4/'%.@ @>D( (rc s^^ US=(d SnUS=(d SnUSS:XaSOUSn[US5n[US 5n[US 5n[US =(d S 5nUS m [US=(d S5n USn U S;=(a U(+n U(+n U S;aSOSn U S;a7U *nU S:XaUS-n[URURX5unnSnU nOkU S;a [ U S5OU S-n[ URURU5unnnU S;=(d US:=(d UU-S:*nU(aUS- OU*nU S:XaSnOU(a U UU-S3nOSnUS US-S3nU(aSOUnUS[U5U- mU[U5U- SnU (aURS 5nU (a U(dSOSnUU-U-nU(a=U[U5- [U5- nTRT (a S U-S!-S-OU5mT (aJS[T5S- S --nTSUSRUU 4S"j[U[T5S 555-mTU-nX([U5- [U5- -nUS:XaUU-U-$US#:XaUU-U-$US$:Xa[U5S-nUSUU-U-UUS-$UU-U-$)%NrQrRrSrTrr%r#rrUzeropadrVr rW precisionZ6presentation_typeZgGZEFGZEZezfF%Z%rIFrZeEriz+03drZ.ic3s6># UHnTTXS--v M g7f)rdN)Z.0ZposleadingrWs r Z Z/Fraction._format_float_style.."s&4Ag 664srXrY) rZr*rrrZmaxrrZrstripZzfillZjoinZrange)!r7r1rQrSr[rr\rarVrbrcZ trim_zerosZ trim_pointZexponent_indicatorrZnegativerZ scientificZ point_posrZsuffixZdigitsrZ frac_partZ separatorZtrailingZ min_leadingZ first_posr]r^r_rfrWs! @@r _format_float_styleZFraction._format_float_stylespV}#g%#v#-25=5/0 eEl+uY'(507C8 o. k*1c2 !"56&$.E~3E '' $5$>SC  %!zH C'A $6!2!2H%K !HkJ!I%,Iq!]  /@!2!2G/= +Hk8"T),a<,g%+  (2! yI  #F *+Hy,@+FGFF )a-12 sH23v;233v;245 !((-I$YBC y(61 &T2S]BKmm,9K1$q({G S\A-22Ijy)BGG4 CL!<4-G!T2SY>? C<T>D( ( c\$;( ( c\w<1$D5D>D(4/'$%.@ @'>D( (rcs[U5=n(aURU5$[U5=n(aUSbUScURU5$[ SU<S[ U5R <35e)NrSrazInvalid format specifier z for object of type )%_GENERAL_FORMAT_SPECIFICATION_MATCHERr`#_FLOAT_FORMAT_SPECIFICATION_MATCHERrgrr)r=)r7Z format_specr1rAr __format__ZFraction.__format__5s:+F F5 F''. .7 D D5 DW~%y)9)A//66' 7""&t*"5"5!8 :  rcs^^^UUU4SjnSTR-S-UlTRUlUUU4SjnSTR-S-UlTRUlX44$)NcsB>[U[5(aT"X5$[U[5(aT"U[U55$[U[5(aT"[U5U5$T(a'[U[5(aT"[ U5U5$[ $rC)r+rr*r.complexNotImplemented)rJbfallback_operatorhandle_complexmonomorphic_operator r forwardZ-Fraction._operator_fallbacks..forwards}!X&&+A11As##+Ax{;;Au%%(q155Jq'$:$:(Q77%%rZ__csh>[U[R5(aT"[U5U5$[U[R5(aT"[ U5[ U55$T(a:[U[R 5(aT"[U5[U55$[$rC) r+r,r-rZRealr.Complexrkrl)rmrJrnrorprqr reverseZ-Fraction._operator_fallbacks..reverses{!W--..+HQK;;Aw||,,(q58<<Jq'//$B$B(WQZ@@%%rZ__r)r=Z__doc__)rprnrorrrts``` r _operator_fallbacksZFraction._operator_fallbacksFsgb & "3"<"< rJrmnadanbdbr8ZsZtg2 r _addZ Fraction._addq~~Bq~~B HHR  6..rw/@"'J J G 'NRV # XXa^ 7..qb&9 9**17ArNCCrcsURURp2URURpT[R"X55nUS:Xa[R X%-X4-- X5-5$X6-nX%U--XG-- n[R"X5n U S:Xa[R XU-5$[R X-XuU --5$rDrvrwr}r _subZ Fraction._subrrcs"URURp2URURpT[R"X%5nUS:aX&-nXV-n[R"XC5nUS:aXG-nX7-n[R X$-XS-5$rDrv)rJrmrxryrzr{g1r|s r _mulZ Fraction._muls}q~~Bq~~B XXb  6 IB IB XXb  6 IB IB**27BG<) rJrmrzr{rxryrr|rrr}r _divZ Fraction._div(sq~~B 7#$5$:; ;q~~B XXb  6 IB IB XXb  6 IB IBw1 q52rq**100rcshURUR-URUR--$rC)r r rJrmr?r _floordivZFraction._floordiv>s' amm+1LMMrFcsURURp2[URU-X!R-5upEU[XRU-54$rC)r rr r)rJrmryr{ZdivZn_mod r _divmodZFraction._divmodDsC BAKK",b;;.>? HUG,,,rcsURURp2[URU-URU--X#-5$rC)r rr )rJrmryr{s r _modZ Fraction._modLs7 Br)akkB.>?IIrcst[U[R5(Ga URS:XaURnUS:a0[ R URU-URU-5$URS:a2[ R URU*-URU*-5$URS:Xa[SURU*--5e[ R UR*U*-UR*U*-5$[U5[U5-$[U5U-$)Nrrr&) r+r,r-r r rr>rrr3r.)rJrmZpowerrAr __pow__ZFraction.__pow__Ss& a)) * *}}! A:#66q||u7L78~~7NPP\\A%#66q~~%7O78||v7MOO\\Q&+,=,-NNuf,D-EFF$66UF7R9: 5&7PRR Qx58++8q= rcs:URS:XaURS:aXR-$[U[R5(a#[ UR UR5U-$URS:XaXR-$U[U5-$)Nrr) rrr+r,r-rr r r.)rmrJr?r __rpow__ZFraction.__rpow__qsz >>Q 1<<1#4 $ $ a)) * *AKK71< < >>Q  $ $E!H}rcsV[RURUR5$rCrr>rrrMrGr __pos__ZFraction.__pos__s**1<<HHrcsX[RUR*UR5$rCrrMrGr __neg__ZFraction.__neg__s**ALL=!..IIrcsh[R[UR5UR5$rC)rr>rrrrMrGr __abs__ZFraction.__abs__s"**3q||+>1 1rcs4URUR-$rCrrMrGr __floor__ZFraction.__floor__s||q~~--rcs8UR*UR-*$rCrrMrGr __ceil__ZFraction.__ceil__s,,!..011rcs*UcMURn[URU5up4US-U:aU$US-U:aUS-$US-S:XaU$US-$S[U5-nUS:a[ [ X-5U5$[ [ X- 5U-5$)NrIrrr )rrrrrZround)r7ZndigitsrZfloorZ remainderZshiftrr __round__ZFraction.__round__s ?!!A%dooq9 E1}q  Q"qy a qy CL  Q;E$,/7 7E$,/%78 8rcsB[URUR5$rC)r rrrFrGr __hash__ZFraction.__hash__st0A0ABBrcsh[U5[La%URU:H=(a URS:H$[ U[ R 5(a9URUR:H=(a URUR:H$[ U[ R5(aURS:Xa URn[ U[5(aN[R"U5(d[R"U5(aSU:H$XR!U5:H$["$)Nrr)r)r*rrr+r,r-r r rsZimagZrealr.r4isnanisinfr@rlrr?r __eq__ZFraction.__eq__s 7c><<1$<1)< < a)) * *LLAKK/4NNamm3 5 a ) )affkA a  zz!}} 1 axLLO++" !rcs[U[R5(a7U"URUR-UR UR -5$[U[5(aV[R"U5(d[R"U5(a U"SU5$U"XRU55$[$)Nr) r+r,r-rr rr r.r4rrr@rl)r7ZotherZoprAr _richcmpZFraction._richcmps eW-- . .doo(9(99''%//9; ; eU # #zz%  DJJu$5$5#u~%$ 677! !rcBURU[R5$rC)roperatorZltrr?r __lt__ZFraction.__lt__zz!X[[))rcrrC)rrZgtrr?r __gt__ZFraction.__gt__rrcrrC)rrZlerr?r __le__ZFraction.__le__rrcrrC)rrZgerr?r __ge__ZFraction.__ge__rrcs,[UR5$rC)rZrrMrGr __bool__ZFraction.__bool__sALL!!rcsJURURUR44$rC)r9rrrFrGr __reduce__ZFraction.__reduce__s $2C2C DEErcx[U5[:XaU$URURUR5$rCr)rr9rrrFrGr __copy__ZFraction.__copy__. : !K~~doot/@/@AArcrrCr)r7Zmemor?r __deepcopy__ZFraction.__deepcopy__ rr)rrr9)rN)i@B)TrC)Kr=Z __module__Z __qualname__Z__firstlineno__Z __slots__r(Z classmethodr@rBr>rHr/rKZpropertyr r rNrPr`rgrjrur~rZaddZ__add__Z__radd__rZsubZ__sub__Z__rsub__rZmulZ__mul__Z__rmul__rZtruedivZ __truediv__Z __rtruediv__rZfloordivZ __floordiv__Z __rfloordiv__rrZ __divmod__Z __rdivmod__rZmodZ__mod__Z__rmod__rrrrrZindexrrrrrrrrrrrrrrrrZ__static_attributes__Z __classcell__)r9s@r rrs*/IgR = = ? ?  &47ArC B )D_)B $,0l d D,D(,,?GX D,D(,,?GX =,D(,,?GX1(!4D(:J:J KKN#6iARARTY"ZL-- 2'65IJ J ,D(,,FGX!< IJN#..:2.2 94C"*",****"FB BBr)F)r"rZ functoolsr4r,rZreZsysZ__all__Z hash_infoZmodulusrZinfrZ lru_cacher ZcompileZVERBOSEZ IGNORECASEr0rrZDOTALLZ fullmatchrhrir-rrerr rs   , --''mm  w'*(*@:: ZZ"-- !":$'P)+ 4YY )'Y&$')jj2YY''Y$$[ Bw[ Br