Files
952-11/env/python/dll/Python312/Lib/__pycache__/fractions.cpython-312.pyc
T

312 lines
36 KiB
Plaintext
Raw Normal View History

2024-08-19 17:05:14 +08:00
Ë
*åf�˜ãóÈ—dZddlmZddlZddlZddlZddlZddlZddlZdgZ ejjZ ejjZejd¬«d„«Zej"dej$ej&z«Zd
d „Zd
„Zej"d ej.ej$z«j0ZGd „dej4«Zy)z/Fraction, infinite-precision, rational numbers.é©ÚDecimalNÚFractioni@)Úmaxsizecó¶— t|dt«}ttt|««|z«}|dk\r|n| }|dk(rdS|S#t$r t
}YŒ$wxYw)Néÿÿÿÿréþÿÿÿ)ÚpowÚ_PyHASH_MODULUSÚhashÚabsÚ
ValueErrorÚ _PyHASH_INF)Ú numeratorÚ denominatorÚdinvÚhash_Úresults úEC:\Users\RCi\AppData\Local\Programs\Python\Python312\Lib\fractions.pyÚ_hash_algorithmrse€ð2Ü�; ¤OÓ4ˆô(”Tœ#˜i›.Ó)¨DÑ0Ó1ˆØ 1’n‰U¨5¨&€Fؘ2’ˆ2Ð) 6Ð)øô+ òäŠðús‚AÁAÁAa¶
\A\s* # optional whitespace at the start,
(?P<sign>[-+]?) # an optional sign, then
(?=\d|\.\d) # lookahead for digit or .digit
(?P<num>\d*|\d+(_\d+)*) # numerator (possibly empty)
(?: # followed by
(?:\s*/\s*(?P<denom>\d+(_\d+)*))? # an optional denominator
| # or
(?:\.(?P<decimal>\d*|\d+(_\d+)*))? # an optional fractional part
(?:E(?P<exp>[-+]?\d+(_\d+)*))? # and optional exponent
)
\s*\Z # and optional whitespace to finish
có°—|dk\r |d|zz}n |d| zz}t||dz z|«\}}|dk(r
|dzdk(r|dz}|r|dkn|dk}|t|«fS)aMRound a rational number to the nearest multiple of a given power of 10.
Rounds the rational number n/d to the nearest integer multiple of
10**exponent, rounding to the nearest even integer multiple in the case of
a tie. Returns a pair (sign: bool, significand: int) representing the
rounded value (-1)**sign * significand * 10**exponent.
If no_neg_zero is true, then the returned sign will always be False when
the significand is zero. Otherwise, the sign reflects the sign of the
input.
d must be positive, but n and d need not be relatively prime.
ré
ér )Údivmodr
)ÚnÚdÚexponentÚ no_neg_zeroÚqÚrÚsigns rÚ_round_to_exponentr"Js|€ð�1‚}Ø ˆR�‰\Ñ‰à ˆR�(�‰]шô �!�q˜A‘v‘, Ó "�D€A€q؈A‚v�!�a‘%˜1’*Ø ˆR‰ˆáˆ1ˆqŠ5 Q¨¡U€DØ ”�Q“ˆ<Ðócó—|dk(rddd|z
fStt|««t|«}}t|«t|«z
||kz}||z
}t|||«\}}tt|««|dzk(r
|dz}|dz
}|||fS)a¡Round a rational number to a given number of significant figures.
Rounds the rational number n/d to the given number of significant figures
using the round-ties-to-even rule, and returns a triple
(sign: bool, significand: int, exponent: int) representing the rounded
value (-1)**sign * significand * 10**exponent.
In the special case where n = 0, returns a significand of zero and
an exponent of 1 - figures, for compatibility with formatting.
Otherwise, the returned significand satisfies
10**(figures - 1) <= significand < 10**figures.
d must be positive, but n and d need not be relatively prime.
figures must be positive.
rFrr)Ústrr
Úlenr") rrÚfiguresÚstr_nÚstr_dÚmrr!Ú significands rÚ_round_to_figuresr,gs¤€ð" ˆA‚vØ�a˜˜W™Ð$Ð$ô”s˜1“v“;¤ A£ˆ5€EÜ ˆE‹
”S˜“ZÑ 5¨E¡>Ñ2€Að�7‰{€HÜ*¨1¨a°Ó:Ñ€Dˆ+ô Œ3ˆ{Ó Ó ¨!¡ Ò+ؘш Ø�A‰
ˆà �˜hÐ &Ð&r#a›
(?:
(?P<fill>.)?
(?P<align>[<>=^])
)?
(?P<sign>[-+ ]?)
(?P<no_neg_zero>z)?
(?P<alt>\#)?
# A '0' that's *not* followed by another digit is parsed as a minimum width
# rather than a zeropad flag.
(?P<zeropad>0(?=[0-9]))?
(?P<minimumwidth>0|[1-9][0-9]*)?
(?P<thousands_sep>[,_])?
(?:\.(?P<precision>0|[1-9][0-9]*))?
(?P<presentation_type>[eEfFgG%])
c󊇗eZdZdZdZd,ˆfd„ Zed„«Zed„«Zeˆfd„«Z d„Z
d„Z d-d „Z e
d
„«Ze
d „«Zd „Zd
„Zd„Zd„Zd„Zeeej,«\ZZd„Zeeej4«\ZZd„Zeeej<«\ZZ d„Z!ee!ejD«\Z#Z$d„Z%ee%ejL«\Z'Z(d„Z)ee)e*«\Z+Z,d„Z-ee-ej\«\Z/Z0d„Z1d„Z2d„Z3d„Z4d„Z5ejlfd„Z7d„Z8d„Z9d„Z:d.d „Z;d!„Z<d"„Z=d#„Z>d$„Z?d%„Z@d&„ZAd'„ZBd(„ZCd)„ZDd*„ZEd+„ZFˆxZGS)/ra]This class implements rational numbers.
In the two-argument form of the constructor, Fraction(8, 6) will
produce a rational number equivalent to 4/3. Both arguments must
be Rational. The numerator defaults to 0 and the denominator
defaults to 1 so that Fraction(3) == 3 and Fraction() == 0.
Fractions can also be constructed from:
- numeric strings similar to those accepted by the
float constructor (for example, '-2.3' or '1e10')
- strings of the form '123/456'
- float and Decimal instances
- other Rational instances (including integers)
©Ú
_numeratorÚ _denominatorcóB•—tt|� |«}|�€©t|«tur||_d|_|St|tj«r$|j|_|j|_|St|ttf«r|j«\|_|_|St|t«rút j#|«}|€t%d|z«‚t |j'd«xsd«}|j'd«}|r t |«}n€d}|j'd«}|r6|j)dd«}d t+|«z}||zt |«z}||z}|j'd
«}|r"t |«}|d k\r |d |zz}n |d | zz}|j'd «d
k(r¤| }n t-d«‚t|«tcxur
t|«urnnnrt|tj«rMt|tj«r3|j|jz|j|jz}}n t-d«‚|d k(rt/d|z«‚t1j2||«} |d kr| } || z}|| z}||_||_|S)a£Constructs a Rational.
Takes a string like '3/2' or '1.5', another Rational instance, a
numerator/denominator pair, or a float.
Examples
--------
>>> Fraction(10, -8)
Fraction(-5, 4)
>>> Fraction(Fraction(1, 7), 5)
Fraction(1, 35)
>>> Fraction(Fraction(1, 7), Fraction(2, 3))
Fraction(3, 14)
>>> Fraction('314')
Fraction(314, 1)
>>> Fraction('-35/4')
Fraction(-35, 4)
>>> Fraction('3.1415') # conversion from numeric string
Fraction(6283, 2000)
>>> Fraction('-47e-2') # string may include a decimal exponent
Fraction(-47, 100)
>>> Fraction(1.47) # direct construction from float (exact conversion)
Fraction(6620291452234629, 4503599627370496)
>>> Fraction(2.25)
Fraction(9, 4)
>>> Fraction(Decimal('1.47'))
Fraction(147, 100)
rz Invalid literal for Fraction: %rÚnumÚ0ÚdenomÚdecimalÚ_ÚrÚexprr!ú-z2argument should be a string or a Rational instancez+both arguments should be Rational instancesúFraction(%s, 0))ÚsuperrÚ__new__ÚtypeÚintr/r0Ú
isinstanceÚnumbersÚRationalrrÚfloatrÚas_integer_ratior%Ú_RATIONAL_FORMATÚmatchrÚgroupÚreplacer&Ú TypeErrorÚZeroDivisionErrorÚmathÚgcd) ÚclsrrÚselfr*r4r5Úscaler8ÚgÚ __class__s €rr<zFraction.__new__ºs˜ø€ô>”X˜sÑ+¨CÓ0ˆà Ñ Ü�I‹¤#Ñ%Ø"+�”Ø$%�Ô!Ø� ä˜I¤w×'7Ñ'7Ô8Ø"+×"5Ñ"5�”Ø$-×$9Ñ$9�Ô!Ø� ä˜I¬¬wÐ'7Ô8à5>×5OÑ5OÓ5QÑ2�” Ô!2Ø� ä˜I¤sÔ+ä$×*Ñ*¨9Ó5�Ø�9Ü$Ð%GØ%.ñ&/ó0ð0ä §¡¨£Ò 5°#Ó6� ØŸ™ Ó(�ÙÜ"% e£*‘Kà"#�KØŸg™g iÓ0�GÙØ")§/¡/°#°rÓ":˜Ø "¤C¨£LÑ 0˜Ø$-°Ñ$5¼¸G» Ñ$D˜ Ø# uÑ,˜ ØŸ'™' %›.�CÙÜ! #›h˜Ø !š8Ø%¨¨S©Ñ0™Ià'¨2°¨t©8Ñ3˜KØ—7‘7˜6“? cÒ)Ø!* 
‘Iô ð!9ó:ð:ô�)‹_¤Ó
8¤t¨KÓ'8Ô
8Ø ä˜¤G×$4Ñ$4Ô5Ü �{¤G×$4Ñ$4Ô 5à×#Ñ# k×&=Ñ&=Ñ=Ø×%Ñ%¨ ×(=Ñ(=Ñ=ð#‰Iô
ð1ó2ð
2ð ˜!Ò Ü#Ð$5¸ Ñ$AÓBÐ BÜ �H‰H�Y  Ó ,ˆØ ˜Š?Ø�ˆAØ�a‰ˆ ؘш Ø#ˆŒØ'ˆÔ؈ r#c ó—t|tj«r||«St|t«s1t |j
›d|›dt
|«j
›d�«‚|j|j«ŽS)z‚Converts a finite float to a rational number, exactly.
Beware that Fraction.from_float(0.3) != Fraction(3, 10).
z%.from_float() only takes floats, not ú (ú)) r?r@ÚIntegralrBrHÚ__name__r=Ú_from_coprime_intsrC)rLÚfs rÚ
from_floatzFraction.from_float#sm€ô �aœ×)Ñ)Ô *Ù�q“6ˆMܘAœuÔ%ÜØ Ÿ\›\ª1¬d°1«g×.>Ó.>ð@óAð
Aà%ˆs×%Ñ% q×'9Ñ'9Ó';Ð<Ð<r#c ó—ddlm}t|tj«r|t |««}n=t||«s1t
|j›d|›dt|«j›d�«‚|j|j«ŽS)zAConverts a finite Decimal instance to a rational number, exactly.rrz).from_decimal() only takes Decimals, not rRrS) r5rr?r@rTr>rHrUr=rVrC)rLÚdecrs rÚ from_decimalzFraction.from_decimal1st€õ $Ü �cœ7×+Ñ+Ô ,Ùœ#˜c›(Ó#‰CܘC Ô)Üà—“šs¤D¨£I×$6Ó$6ð8ó9ð
9ð&ˆs×%Ñ% s×';Ñ';Ó'=Ð>Ð>r#cóJ•—tt|� |«}||_||_|S)z°Convert a pair of ints to a rational number, for internal use.
The ratio of integers should be in lowest terms and the denominator
should be positive.
)r;rr<r/r0)rLrrÚobjrPs €rrVzFraction._from_coprime_ints=s*ø€ô”H˜cÑ*¨3Ó/ˆØ"ˆŒØ&ˆÔ؈
r#có —|jdk(S)z*Return True if the Fraction is an integer.r©r0©rMs rÚ
is_integerzFraction.is_integerIs€à× Ñ  AÑ%Ð%r#có2—|j|jfS)z˜Return a pair of integers, whose ratio is equal to the original Fraction.
The ratio is in lowest terms and has a positive denominator.
r.r`s rrCzFraction.as_integer_ratioMs€ð
—‘ ×!2Ñ!2Ð3Ð3r#cóª—|dkr td«‚|j|kr t|«Sd\}}}}|j|j}} ||z}|||zz} | |kDrn|||||zz| f\}}}}||||zz
}}Œ/||z
|z}
d|z||
|zzz|jkrtj ||«Stj ||
|zz||
|zz«S)aWClosest Fraction to self with denominator at most max_denominator.
>>> Fraction('3.141592653589793').limit_denominator(10)
Fraction(22, 7)
>>> Fraction('3.141592653589793').limit_denominator(100)
Fraction(311, 99)
>>> Fraction(4321, 8765).limit_denominator(10000)
Fraction(4321, 8765)
rz$max_denominator should be at least 1)rrrré)rr0rr/rV) rMÚmax_denominatorÚp0Úq0Úp1Úq1rrÚaÚq2Úks rÚlimit_denominatorzFraction.limit_denominatorTs€ð@ ˜QÒ ÜÐCÓDÐ DØ × Ñ  Ò /ܘD“>Ð !à#‰ˆˆB��BØ�‰ × 1Ñ 1ˆ1ˆØØ�1‘ˆAØ�A�b‘D‘ˆBØ�OÒ#ØØ  R¨¨"©¡W¨bÐ0‰NˆB��B˜Ø�a˜˜!™‘eˆqˆAð
ð˜RÑ
 "Ñ $ˆð
ˆQ‰3��1�R‘4‘‰=˜D×-Ñ-Ò -Ü×.Ñ.¨r°2Ó6Ð 6ä×.Ñ.¨r°!°B±$©w¸¸1¸R¹4¹Ó@Ð @r#có—|jS©N)r/©rjs rrzFraction.numerator�s €à�|‰|Ðr#có—|jSror_rps rrzFraction.denominator‘s €à�~‰~Ðr#cóh—|jj›d|j›d|j›d�S)z
repr(self)ú(z, rS)rPrUr/r0r`s rÚ__repr__zFraction.__repr__•s*€à#Ÿ~™~×6Ó6Ø#Ÿ›°×0AÓ0AðCð Cr#có€—|jdk(rt|j«S|j›d|j›�S)z str(self)rú/)r0r%r/r`s rÚ__str__zFraction.__str__šs4€à × Ñ  Ò !Ü�t—‘Ó'Ð 'à"Ÿo›o¨t×/@Ò/@ÐAÐ Ar#c
óÖ‡ ‡!—|s t|«St|«}|€$td|›dt|«j›�«‚|d�*|d�%td|›dt|«j›d�«‚|dxsd}|dxsd }|d
d k(rd n|d
}t |d
«}t |d«}t |d«}t
|dxsd«} |dŠ!t
|dxsd«}
|d} | dvxr| } | }
| dvrdnd}| dvr7|
}| dk(r|dz}t|j|j||«\}}d}|
}nY| dvr t|
d«n|
dz}t|j|j|«\}}}| dvxs|dkDxs||zd k}|r|dz
n| }| dk(rd}n|r |›||zd!›�}nd }|d|dz›d"�›}|rd n|}|dt|«|z
Š |t|«|z
d}| r|jd«}|
r|sd nd#}||z|z}|r8| t|«z
t|«z
}‰ j‰!r d$|zd%zdzn|«Š ‰!rIdt‰ «dz
d$zz}‰ d|d jˆ ˆ!fd&„t!|t‰ «d$«D««zŠ ‰ |z}|| t|«z
t|«z
z}|d k(r||z|zS|d'k(r||z|zS|d(k(rt|«dz}|d||z|z||dzS||z|zS))zAFormat this fraction according to the given format specification.NzInvalid format specifier z for object of type ÚalignÚzeropadz0; can't use explicit alignment when zero-paddingÚfillú ú>r!r9r7rÚaltÚ minimumwidthr3Ú
thousands_sepÚ precisionÚ6Úpresentation_typeÚgGÚEFGÚEÚezfF%ú%rdFrÚeEréüÿÿÿz+03drú.ééc3ó4•K—|]}‰‰||dzz–—Œy­w)rŒN©)Ú.0ÚposÚleadingr€s €€rú <genexpr>z&Fraction.__format__.<locals>.<genexpr>s)øèø€ò4à𠨨c°A©gÐ 6Õ6ñ4ùsƒú<ú^)r%Ú#_FLOAT_FORMAT_SPECIFICATION_MATCHERrr=rUÚboolr>r"r/r0Úmaxr,r&ÚrstripÚzfillÚjoinÚrange)"rMÚ format_specrEr{ryÚpos_signrÚalternate_formrzrr�rƒÚ
trim_zerosÚ
trim_pointÚexponent_indicatorrÚnegativer+Ú
scientificÚ point_posr'ÚsuffixÚdigitsr!Ú frac_partÚ separatorÚtrailingÚ min_leadingÚ first_posÚbodyÚpaddingÚhalfr’r€s" @@rÚ
__format__zFraction.__format__¡sù€ñÜ�t“9Ð ô4°KÓ@ˆØ ˆ=ÜØ+¨K¨?ð;&Ü&*¨4£j×&9Ñ&9Ð%<ð>óð
ð�7‰^Ð
'¨E°)Ñ,<Ð,HäØ+¨K¨?ð;&Ü&*¨4£j×&9Ñ&9Ð%<ð=AðAóð
ð
�V‰}Ò# ˆØ�g‘Ò% #ˆØ˜v™¨#Ò-‘2°5¸±=ˆÜ˜5 Ñ/Ó0ˆ ܘe E™lÓ+ˆÜ�u˜YÑ'Ó(ˆÜ˜5 Ñ0Ò7°CÓ8ˆ ؘoÑ.ˆ
ܘ˜kÑ*Ò1¨cÓ2ˆ Ø!Ð"5Ñ6ÐØ&¨$Ð.ÒE°~Ð3Eˆ
Ø'Ð'ˆ
Ø$5¸Ñ$>™SÀCÐð  Ñ %Ø!�zˆHØ  CÒ'ؘA‘
�Ü$6Ø—‘ ×!2Ñ!2°H¸kó%KÑ !ˆH�kàˆJØ!‰Ið%¨Ñ,ô�I˜qÔ!à ‘]ð
ô
/@Ø—‘ ×!2Ñ!2°Gó/=Ñ +ˆH�k 8ð" TÐ)ò,ؘa‘<ò,à˜gÑ%¨Ñ+ð
ñ
(2˜ !š ¸°yˆIð  Ò #؉FÙ
Ø*Ð+¨H°yÑ,@ÀÐ+FÐG‰FàˆFð   )¨a¡- °Ð1Ð2ˆñ
‰s HˆØÐ2œ3˜v›;¨Ñ2Ð3ˆØœ3˜v›;¨Ñ2Ð4Ð5ˆ Ù Ø!×(Ñ(¨Ó-ˆIÙ$©Y‘B¸Cˆ ؘyÑ(¨6Ñ1ˆñ Ø&¬¨T«Ñ2´S¸³]ÑBˆKð—m‘mÙ,9��K‘ 1Ñ$ qÒ(¸{óˆGñ
ØœS ›\¨AÑ-°Ñ2Ñ2ˆIؘj˜yÐ)¨B¯G©Gô4ä  ¬C°«L¸!Ó<ô4ó-ñˆGð˜Ñ!ˆØ˜,¬¨T«Ñ2´S¸³YÑ>Ñ?ˆØ �CŠ<ؘT‘> DÑ(Ð (Ø
�cŠ\ؘ$‘; Ñ(Ð (Ø
�cŠ\Ü�w“< 1Ñ$ˆDؘ5˜D�> DÑ(¨4Ñ/°'¸$¸%°.Ñ@Ð @à˜'‘> DÑ(Ð (r#c󯇇—ˆˆfd„}d‰jzdz|_‰j|_ˆˆfd„}d‰jzdz|_‰j|_||fS)aÕGenerates forward and reverse operators given a purely-rational
operator and a function from the operator module.
Use this like:
__op__, __rop__ = _operator_fallbacks(just_rational_op, operator.op)
In general, we want to implement the arithmetic operations so
that mixed-mode operations either call an implementation whose
author knew about the types of both arguments, or convert both
to the nearest built in type and do the operation there. In
Fraction, that means that we define __add__ and __radd__ as:
def __add__(self, other):
# Both types have numerators/denominator attributes,
# so do the operation directly
if isinstance(other, (int, Fraction)):
return Fraction(self.numerator * other.denominator +
other.numerator * self.denominator,
self.denominator * other.denominator)
# float and complex don't have those operations, but we
# know about those types, so special case them.
elif isinstance(other, float):
return float(self) + other
elif isinstance(other, complex):
return complex(self) + other
# Let the other type take over.
return NotImplemented
def __radd__(self, other):
# radd handles more types than add because there's
# nothing left to fall back to.
if isinstance(other, numbers.Rational):
return Fraction(self.numerator * other.denominator +
other.numerator * self.denominator,
self.denominator * other.denominator)
elif isinstance(other, Real):
return float(other) + float(self)
elif isinstance(other, Complex):
return complex(other) + complex(self)
return NotImplemented
There are 5 different cases for a mixed-type addition on
Fraction. I'll refer to all of the above code that doesn't
refer to Fraction, float, or complex as "boilerplate". 'r'
will be an instance of Fraction, which is a subtype of
Rational (r : Fraction <: Rational), and b : B <:
Complex. The first three involve 'r + b':
1. If B <: Fraction, int, float, or complex, we handle
that specially, and all is well.
2. If Fraction falls back to the boilerplate code, and it
were to return a value from __add__, we'd miss the
possibility that B defines a more intelligent __radd__,
so the boilerplate should return NotImplemented from
__add__. In particular, we don't handle Rational
here, even though we could get an exact answer, in case
the other type wants to do something special.
3. If B <: Fraction, Python tries B.__radd__ before
Fraction.__add__. This is ok, because it was
implemented with knowledge of Fraction, so it can
handle those instances before delegating to Real or
Complex.
The next two situations describe 'b + r'. We assume that b
didn't know about Fraction in its implementation, and that it
uses similar boilerplate code:
4. If B <: Rational, then __radd_ converts both to the
builtin rational type (hey look, that's us) and
proceeds.
5. Otherwise, __radd__ tries to find the nearest common
base ABC, and fall back to its builtin type. Since this
class doesn't subclass a concrete type, there's no
implementation to fall back to, so we need to try as
hard as possible to return an actual value, or the user
will get a TypeError.
có•—t|t«r ‰||«St|t«r‰|t|««St|t«r‰t|«|«St|t«r‰t |«|«St
Sro)r?rr>rBÚcomplexÚNotImplemented)rjÚbÚfallback_operatorÚmonomorphic_operators €€rÚforwardz-Fraction._operator_fallbacks.<locals>.forwardesqø€Ü˜!œXÔ&Ù+¨A¨qÓ1Ð1ܘAœsÔ#Ù+¨A¬x¸«{Ó;Ð;ܘAœuÔ%Ù(¬¨q«°1Ó5Ð5ܘAœwÔ'Ù(¬°«°QÓ7Ð7ä%Ð%r#Ú__có<•—t|tj«r‰t|«|«St|tj«r‰t |«t |««St|tj «r‰t|«t|««StSro) r?r@rArÚRealrBÚComplexr³r´)rµrjr¶r·s €€rÚreversez-Fraction._operator_fallbacks.<locals>.reversesspø€Ü˜!œW×-Ñ-Ô.á+¬H°Q«K¸Ó;Ð;ܘAœwŸ|™|Ô,Ù(¬¨q«´5¸³8Ó<Ð<ܘAœwŸ™Ô/Ù(¬°«´W¸Q³ZÓ@Ð@ä%Ð%r#Ú__r)rUÚ__doc__)r·r¶r¸r½s`` rÚ_operator_fallbackszFraction._operator_fallbackssiù€õ`
&ð Ð"3×"<Ñ"<Ñ<¸tÑCˆÔØ.×6Ñ6ˆŒõ &ð!Ð#4×#=Ñ#=Ñ=ÀÑDˆÔØ.×6Ñ6ˆŒà˜ÐÐr#có¨—|j|j}}|j|j}}tj||«}|dk(r"tj ||z||zz||z«S||z}|||zz||zz}tj||«} | dk(rtj |||z«Stj || z||| zz«S)za + br©r/r0rJrKrrV©
rjrµÚnaÚdaÚnbÚdbrOÚsÚtÚg2s
rÚ_addz
Fraction._addÆóÊ€à—‘˜qŸ~™~ˆBˆØ—‘˜qŸ~™~ˆBˆÜ �H‰H�R˜Ó ˆØ �Š6Ü×.Ñ.¨r°B©w¸¸b¹Ñ/@À"ÀrÁ'ÓJÐ JØ �!‰GˆØ �"˜‘'‰N˜R !™VÑ #ˆÜ
�X‰X�a˜‹^ˆØ
�Š7Ü×.Ñ.¨q°!°b±&Ó9Ð 9Ü×*Ñ*¨1°©7°A¸¸r¹±NÓCÐCr#có¨—|j|j}}|j|j}}tj||«}|dk(r"tj ||z||zz
||z«S||z}|||zz||zz
}tj||«} | dk(rtj |||z«Stj || z||| zz«S)za - brrÂrÃs
rÚ_subz
Fraction._subÖrÌr#có.—|j|j}}|j|j}}tj||«}|dkDr
||z}||z}tj||«}|dkDr
||z}||z}tj ||z||z«S)za * brrÂ)rjrµrÄrÅrÆrÇÚg1rÊs rÚ_mulz
Fraction._mulæs‘€à—‘˜qŸ~™~ˆBˆØ—‘˜qŸ~™~ˆBˆÜ
�X‰X�b˜"Ó
ˆØ
�Š6Ø �2‰IˆBØ �2‰IˆBÜ
�X‰X�b˜"Ó
ˆØ