Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
fractions.cpython-314.pyc353 linesDownload Raw Back to __pycache__
1+
2��i����@�Rt^RIt^RIt^RIt^RIt^RIt^RItR.t]PPt3]PPt]P!RR7R4t]P!R]P ]P",4tRRltRt]P!R]P*]P ,4P,t]P!R	]P*]P ,4P,t!R4R]P24tR#)
z/Fraction, infinite-precision, rational numbers.N�Fraction)�maxsizec���\VR\4p\\\V44V,4pV^8�dTMV)pVR8XdR#T# \d5\6pL*i;i)�����������)�pow�_PyHASH_MODULUS�hash�abs�7ValueError�_PyHASH_INF)�	numerator�denominator�dinv�hash_�results&&   �Lib\fractions.py�_hash_algorithmrse��2��;��O�4��(�T�#�i�.�)�D�0�1���1�n�U�5�&�F��2��2�)�6�)��+�����s�A�A"�!A"a�8    \A\s*                                  # optional whitespace at the start,9    (?P<sign>[-+]?)                        # an optional sign, then10    (?=\d|\.\d)                            # lookahead for digit or .digit11    (?P<num>\d*|\d+(_\d+)*)                # numerator (possibly empty)12    (?:                                    # followed by13       (?:\s*/\s*(?P<denom>\d+(_\d+)*))?   # an optional denominator14    |                                      # or15       (?:\.(?P<decimal>\d*|\d+(_\d+)*))?  # an optional fractional part16       (?:E(?P<exp>[-+]?\d+(_\d+)*))?      # and optional exponent17    )18    \s*\z                                  # and optional whitespace to finish19c��V^8�dV^20V,,pMV^21V),,p\W^,	,V4wrEV^8XdV^,^8Xd22VR,pV'dV^8MV^8pV\V43#)a)Round a rational number to the nearest multiple of a given power of 10.23 24Rounds the rational number n/d to the nearest integer multiple of2510**exponent, rounding to the nearest even integer multiple in the case of26a tie. Returns a pair (sign: bool, significand: int) representing the27rounded value (-1)**sign * significand * 10**exponent.28 29If no_neg_zero is true, then the returned sign will always be False when30the significand is zero. Otherwise, the sign reflects the sign of the31input.32 33d must be positive, but n and d need not be relatively prime.34r)�divmodr)�n�d�exponent�no_neg_zero�q�r�signs&&&&   r�_round_to_exponentrIsx���1�}�	�R��\���	�R�(��]����!�A�v�,��"�D�A��A�v�!�a�%�1�*�	�R����1�q�5�Q��U�D���Q��<��c�D�V^8Xd
R^^V,353#\\V44\V4rC\V4\V4,36WC8*,pWR,37p\WV4wrx\\V44V^,8XdV^38,pV^,
pWxV3#)auRound a rational number to a given number of significant figures.39 40Rounds the rational number n/d to the given number of significant figures41using the round-ties-to-even rule, and returns a triple42(sign: bool, significand: int, exponent: int) representing the rounded43value (-1)**sign * significand * 10**exponent.44 45In the special case where n = 0, returns a significand of zero and46an exponent of 1 - figures, for compatibility with formatting.47Otherwise, the returned significand satisfies4810**(figures - 1) <= significand < 10**figures.49 50d must be positive, but n and d need not be relatively prime.51figures must be positive.52F)�strr�lenr)	rr�figures�str_n�str_d�mrr�significands	&&&      r�_round_to_figuresr(fs���"	�A�v��a��W��$�$��s�1�v�;��A��5��E�53�S��Z��5�>�2�A��{�H�*�1��:��D��3�{����!��+������A�
���h�&�&ray54    (?:55        (?P<fill>.)?56        (?P<align>[<>=^])57    )?58    (?P<sign>[-+ ]?)59    # Alt flag forces a slash and denominator in the output, even for60    # integer-valued Fraction objects.61    (?P<alt>\#)?62    # We don't implement the zeropad flag since there's no single obvious way63    # to interpret it.64    (?P<minimumwidth>0|[1-9][0-9]*)?65    (?P<thousands_sep>[,_])?66a�67    (?:68        (?P<fill>.)?69        (?P<align>[<>=^])70    )?71    (?P<sign>[-+ ]?)72    (?P<no_neg_zero>z)?73    (?P<alt>\#)?74    # A '0' that's *not* followed by another digit is parsed as a minimum width75    # rather than a zeropad flag.76    (?P<zeropad>0(?=[0-9]))?77    (?P<minimumwidth>[0-9]+)?78    (?P<thousands_sep>[,_])?79    (?:\.80        (?=[,_0-9])  # lookahead for digit or separator81        (?P<precision>[0-9]+)?82        (?P<frac_separators>[,_])?83    )?84    (?P<presentation_type>[eEfFgG%])85c��aa�]tRt^�toRtR0tR1V3Rllt]R4t]R4t	]R4t86]V3Rl4tRtRt
R2R	lt]R874t]R4tRtR
tRtRtRtR3RltRt]!]]P44wttRt]!]]P<4wtt Rt!]!]!]PD4wt#t$Rt%]!]%]PL4wt't(Rt)]!])]PTR4wt+t,Rt-]!]-].R4wt/t0Rt1]!]1]PdR4wt3t4R4Rlt5R4Rlt6Rt7Rt8Rt9]Pt3Rlt;R t<R!t=R"t>R4R#lt?R$t@R%tAR&tBR'tCR(tDR)tER*tFR+tGR,tHR-tIR.tJR/tKVtLV;tM#)5ra1This class implements rational numbers.88 89In the two-argument form of the constructor, Fraction(8, 6) will90produce a rational number equivalent to 4/3. Both arguments must91be Rational. The numerator defaults to 0 and the denominator92defaults to 1 so that Fraction(3) == 3 and Fraction() == 0.93 94Fractions can also be constructed from:95 96  - numeric strings similar to those accepted by the97    float constructor (for example, '-2.3' or '1e10')98 99  - strings of the form '123/456'100 101  - float and Decimal instances102 103  - other Rational instances (including integers)104 105c�x<�\\V`V4pVEf \V4\JdWn^VnV#\V\P4'd%VPVnVPVnV#\V\4'g)\V\4'g2\VR4'd VP4wVnVnV#\V\4'Ed;\ P#V4pVf\%RV,4h\	VP'R4;'gR4pVP'R4pV'd
\	V4pM�^pVP'R4pV'dEVP)RR4p^106\+V4,pW,\	V4,pW',pVP'R	4pV'd5\	V4pV^8�dV^107V,,pMV^108V),,pVP'R1094R8XdV)pM�\-R4h\V4\u;Jd\V4JdMMM�\V\P4'd[\V\P4'd;VPVP,VPVP,r!M\-R
4hV^8Xd\/RV,4h\0P2!W4p	V^8dV	)p	W,pW),pWnW#nV#)a�Constructs a Rational.110 111Takes a string like '3/2' or '1.5', another Rational instance, a112numerator/denominator pair, or a float.113 114Examples115--------116 117>>> Fraction(10, -8)118Fraction(-5, 4)119>>> Fraction(Fraction(1, 7), 5)120Fraction(1, 35)121>>> Fraction(Fraction(1, 7), Fraction(2, 3))122Fraction(3, 14)123>>> Fraction('314')124Fraction(314, 1)125>>> Fraction('-35/4')126Fraction(-35, 4)127>>> Fraction('3.1415') # conversion from numeric string128Fraction(6283, 2000)129>>> Fraction('-47e-2') # string may include a decimal exponent130Fraction(-47, 100)131>>> Fraction(1.47)  # direct construction from float (exact conversion)132Fraction(6620291452234629, 4503599627370496)133>>> Fraction(2.25)134Fraction(9, 4)135>>> Fraction(Decimal('1.47'))136Fraction(147, 100)137 138�as_integer_ratioz Invalid literal for Fraction: %r�num�0�denom�decimal�_��expr�-zXargument should be a string or a Rational instance or have the as_integer_ratio() methodz+both arguments should be Rational instances�Fraction(%s, 0))�superr�__new__�type�int�139_numerator�_denominator�140isinstance�numbers�Rationalrr�float�hasattrr+r!�_RATIONAL_FORMAT�matchr�group�replacer"�	TypeError�ZeroDivisionError�math�gcd)�clsrr�selfr&r.r/�scaler2�g�	__class__s&&&       �rr6�Fraction.__new__�s����>�X�s�+�C�0�����I��#�%�"+��$%��!����I�w�'7�'7�8�8�"+�"5�"5���$-�$9�$9��!����Y��.�.�!�)�T�2�2��9�&8�9�9�5>�5O�5O�5Q�2����!2����I�s�+�+�$�*�*�9�5���9�$�%G�%.�&/�0�0������� 5� 5�#�6�	�����(���"%�e�*�K�"#�K��g�g�i�0�G��")�/�/�#�r�":�� "�C��L� 0��$-�$5��G��$D�	�#�,���'�'�%�.�C��!�#�h���!�8�%��S��0�I�'�2��t�8�3�K��7�7�6�?�c�)�!*�141�I�� �!Q�R�R��)�_��
8�t�K�'8�
8����G�$4�$4�5�5��{�G�$4�$4�5�5��#�#�k�&=�&=�=��%�%�	�(=�(=�=�#�142�1�2�
2��!��#�$5�	�$A�B�B��H�H�Y�,����?���A���	����#��'���rc��\V4\JdVPV^4#\V\P1434'd'VPVPVP4#\V\4'g)\V\4'g1\VR4'dVP!VP4!#\R4h)zyConverts a finite real number to a rational number, exactly.144 145Beware that Fraction.from_number(0.3) != Fraction(3, 10).146 147r+zLargument should be a Rational instance or have the as_integer_ratio() method)r7r8�_from_coprime_intsr;r<r=rrr>r?r+rD)rH�numbers&&r�from_number�Fraction.from_number9s�����<�3���)�)�&�!�4�4�
��� 0� 0�
1�
1��)�)�&�*:�*:�F�<N�<N�O�O����'�'��f�d�+�+��v�1�2�2��)�)�6�+B�+B�+D�E�E��A�B�
Brc	�"�\V\P4'd	V!V4#\V\4'g5\	VP148:RV:R\
V4P149:R24hVP!VP4!#)zrConverts a finite float to a rational number, exactly.150 151Beware that Fraction.from_float(0.3) != Fraction(3, 10).152 153z%.from_float() only takes floats, not � (�))	r;r<�Integralr>rD�__name__r7rOr+)rH�fs&&r�154from_float�Fraction.from_floatOsq���a��)�)�*�*��q�6�M��A�u�%�%�� �\�\�1�d�1�g�.>�.>�@�A�
A��%�%�q�'9�'9�';�<�<rc	�8�^RIHp\V\P4'dV!\V44pME\W4'g5\
VP:RV:R\V4P:R24hVP!VP4!#)zAConverts a finite Decimal instance to a rational number, exactly.)�Decimalz).from_decimal() only takes Decimals, not rTrU)r/r\r;r<rVr8rDrWr7rOr+)rH�decr\s&& r�from_decimal�Fraction.from_decimal]sv��	$��c�7�+�+�,�,��#�c�(�#�C��C�)�)�����s�D��I�$6�$6�8�9�
9��%�%�s�';�';�'=�>�>rc�F<�\\V`V4pWnW#nV#)z�Convert a pair of ints to a rational number, for internal use.155 156The ratio of integers should be in lowest terms and the denominator157should be positive.158)r5rr6r9r:)rHrr�objrLs""" �rrO�Fraction._from_coprime_intsis&����H�c�*�3�/��"��&���159rc� �VP^8H#)z*Return True if the Fraction is an integer.�r:�rIs&r�160is_integer�Fraction.is_integerus��� � �A�%�%rc�2�VPVP3#)z�Return a pair of integers, whose ratio is equal to the original Fraction.161 162The ratio is in lowest terms and has a positive denominator.163�r9r:res&rr+�Fraction.as_integer_ratioys��164����!2�!2�3�3rc� �V^8d\R4hVPV8:d\V4#Rwr#rEVPVPrvWg,pW8V,,p	W�8�dM&WEW(V,,V	3wr#rEYvW�,,165rvKEW,166V,p167^V,W:V,,,VP8:d\P	WE4#\P	W*V,,W:V,,4#)aClosest Fraction to self with denominator at most max_denominator.168 169>>> Fraction('3.141592653589793').limit_denominator(10)170Fraction(22, 7)171>>> Fraction('3.141592653589793').limit_denominator(100)172Fraction(311, 99)173>>> Fraction(4321, 8765).limit_denominator(10000)174Fraction(4321, 8765)175 176z$max_denominator should be at least 1)�rrrl)rr:rr9rO)rI�max_denominator�p0�q0�p1�q1rr�a�q2�ks&&         r�limit_denominator�Fraction.limit_denominator�s���@�Q���C�D�D�����/��D�>�!�#�������� 1� 1�1����A��b�D��B��#���R�"��W�b�0�N�B�B����e�q�
�
�"�$��
�Q�3��R�4��=�D�-�-�-��.�.�r�6�6��.�.�r�B�$�w��R�4��@�@rc��VP#�N)r9�rrs&rr�Fraction.numerator�s���|�|�rc��VP#rxrdrys&rr�Fraction.denominator�s���~�~�rc�n�VPP:RVP:RVP:R2#)z177repr(self)�(z, rU)rLrWr9r:res&r�__repr__�Fraction.__repr__�s*��#�~�~�6�6�#����0A�0A�C�	Crc��VP^8Xd\VP4#VP:RVP:2#)z	str(self)�/)r:r!r9res&r�__str__�Fraction.__str__�s4������!��t���'�'�"�o�o�t�/@�/@�A�Arc���VR,;'gRpVR,;'gRpVR,R8XdRMVR,p\VR,4p\VR	,;'gR1784pVR,;'gRpVPVPr�V	^8�g	V'd\	V4V
RW�
2p179M\	V4V
p180V^8dRMTpW&\V4,181\V1824,183,pVR8XdW�,V184,#VR
8XdW�,V,#VR8Xd/\V4^,p
VRV
V,V185,W�R,#W�,V186,#)z}Helper method for __format__.187 188Handles fill, alignment, signs, and thousands separators in the189case of no presentation type.190�fill� �align�>rr3r1�alt�minimumwidthr-�
thousands_sepr��<�^N)�boolr8r9r:rr")rIrAr�r��pos_sign�alternate_formr�r�rr�bodyr�padding�halfs&&            r�_format_general�Fraction._format_general�sM���V�}�#�#����g��%�%�#���v��#�-�2�5��=���e�E�l�+���5��0�7�7�C�8���o�.�4�4�"�
����� 1� 1�1��q�5�N��!�f�m�_�-�Q�q��.A�B�D��!�f�m�_�-�D��!�e�s�����T��2�S��Y�>�?���C�<��>�D�(�(�
�c�\��;��(�(�
�c�\��w�<�1�$�D��5�D�>�D�(�4�/�'�%�.�@�@��>�D�(�(rc191�aa a!�VR,;'gRpVR,;'gRpVR,R8XdRMVR,p\VR,4p\VR	,4p\VR192,4p\VR,;'gR4pVR
,o!\VR,;'gR4p	VR,;'gRp193VR,pVR9;'dV'*pV'*p
VR9dRMRpVR8Xd194VR8XdRpVR9d=V	)pVR8Xd195V^,p\VPVPW�4wppRpT	pM{VR9d
\V	^4MV	^,p\
VPVPV4wpppVR9;'gV^8�;'g
VV,R$8*pV'd196V^,197MV)pVR8XdRpMV'dVVV,R
2pMRpVRV^,R2
pV'dRMTpVR\V4V,198o V\V4V,199RoV'dSPR4oV
'dS'gRMRpV200'd0V201PV3R l\^\S4^444oVS,V,pV'dSV\V4,202\V4,203pS PS!'d^V,^,^,MT4o S!'d[^\S 4^,204^,,pS RVRPV V!3R!l\V\S 4^444,o S V,pW(\V4,205\V4,206,pVR8XdVV,V,#VR"8XdVV,V,#VR#8Xd0\V4^,pVRVV,V,VVR,#VV,V,#)%z?Helper method for __format__; handles float presentation types.r�r�r�r�rr3r1rr��zeropadr�r-r��	precision�6�frac_separators�presentation_type�gG�EFG�E�e�=TzfF%�%F�eEz+03drN�.c3�:<"�TFpSW^,x�K	R#5i��N�)�.0�pos�	frac_parts& �r�	<genexpr>�/Fraction._format_float_style.<locals>.<genexpr>4s"����&N�1L�#�'0��!�G�&<�1L�s�c3�H<"�TFpSSW^,,x�K	R#5ir�r�)r�r��leadingr�s& ��rr�r�Ds)����4�<�C����A�g� 6�6�6�<�s�"r�r������)r�r8rr9r:�maxr(r"�rstrip�join�range�zfill)"rIrAr�r�r�rr�r�r�r��frac_sepr��207trim_zeros�208trim_point�exponent_indicatorr�negativer'�209scientific�	point_posr#�suffix�digitsr�	separator�trailing�min_leading�	first_posr�r�r�r�r�r�s"&&                             @@@r�_format_float_style�Fraction._format_float_style�s�����V�}�#�#����g��%�%�#���v��#�-�2�5��=���5��/�0���e�E�l�+���u�Y�'�(���5��0�7�7�C�8���o�.�
���k�*�1�1�c�2�	��*�+�1�1�r��!�"5�6��&�$�.�E�E�~�3E�210�'�'�211�$5��$>�S�C���C�<�D�C�K��G���%�!�z�H� �C�'��A�
��$6�����!2�!2�H�%K�!�H�k��J�!�I�%��,��I�q�!���]�
�212/@�����!2�!2�G�/=�+�H�k�8�"�T�)�,�,��a�<�,�,��g�%��+�
�213(2��!���y�I���#��F�
�*�+�H�y�,@��+F�G�F��F� ��)�a�-���1�2��214�s�H���2�3�v�;��2�3���3�v�;��2�4�5�	��!�(�(��-�I�$�Y�B�C�	�� �
�
�&N�16�q�#�i�.�!�1L�&N�N�I��y�(�6�1���&��T��2�S��]�B�K��m�m�,9��K��1�$�q�(�{��G�215��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�(�(rc�216�\V4;p'dVPV4#\V4;p'd(VR,eVR,fVPV4#\	RV:R\V4P:24h)zAFormat this fraction according to the given format specification.r�r�zInvalid format specifier z for object of type )�%_GENERAL_FORMAT_SPECIFICATION_MATCHERr��#_FLOAT_FORMAT_SPECIFICATION_MATCHERr�rr7rW)rI�format_specrAs"" r�217__format__�Fraction.__format__Ws���:�+�F�F�5�F��'�'��.�.�7��D�D�5�D��W�~�%��y�)9�)A��/�/��6�6��'���7"�"&�t�*�"5�"5�!8�
:�218�	219rc��aaa�VVV3RlpRSP,R,VnSPVnVVV3RlpRSP,R,VnSPVnW43#)a�
Generates forward and reverse operators given a purely-rational220operator and a function from the operator module.221 222Use this like:223__op__, __rop__ = _operator_fallbacks(just_rational_op, operator.op)224 225In general, we want to implement the arithmetic operations so226that mixed-mode operations either call an implementation whose227author knew about the types of both arguments, or convert both228to the nearest built in type and do the operation there. In229Fraction, that means that we define __add__ and __radd__ as:230 231    def __add__(self, other):232        # Both types have numerators/denominator attributes,233        # so do the operation directly234        if isinstance(other, (int, Fraction)):235            return Fraction(self.numerator * other.denominator +236                            other.numerator * self.denominator,237                            self.denominator * other.denominator)238        # float and complex don't have those operations, but we239        # know about those types, so special case them.240        elif isinstance(other, float):241            return float(self) + other242        elif isinstance(other, complex):243            return complex(self) + other244        # Let the other type take over.245        return NotImplemented246 247    def __radd__(self, other):248        # radd handles more types than add because there's249        # nothing left to fall back to.250        if isinstance(other, numbers.Rational):251            return Fraction(self.numerator * other.denominator +252                            other.numerator * self.denominator,253                            self.denominator * other.denominator)254        elif isinstance(other, Real):255            return float(other) + float(self)256        elif isinstance(other, Complex):257            return complex(other) + complex(self)258        return NotImplemented259 260 261There are 5 different cases for a mixed-type addition on262Fraction. I'll refer to all of the above code that doesn't263refer to Fraction, float, or complex as "boilerplate". 'r'264will be an instance of Fraction, which is a subtype of265Rational (r : Fraction <: Rational), and b : B <:266Complex. The first three involve 'r + b':267 268    1. If B <: Fraction, int, float, or complex, we handle269       that specially, and all is well.270    2. If Fraction falls back to the boilerplate code, and it271       were to return a value from __add__, we'd miss the272       possibility that B defines a more intelligent __radd__,273       so the boilerplate should return NotImplemented from274       __add__. In particular, we don't handle Rational275       here, even though we could get an exact answer, in case276       the other type wants to do something special.277    3. If B <: Fraction, Python tries B.__radd__ before278       Fraction.__add__. This is ok, because it was279       implemented with knowledge of Fraction, so it can280       handle those instances before delegating to Real or281       Complex.282 283The next two situations describe 'b + r'. We assume that b284didn't know about Fraction in its implementation, and that it285uses similar boilerplate code:286 287    4. If B <: Rational, then __radd_ converts both to the288       builtin rational type (hey look, that's us) and289       proceeds.290    5. Otherwise, __radd__ tries to find the nearest common291       base ABC, and fall back to its builtin type. Since this292       class doesn't subclass a concrete type, there's no293       implementation to fall back to, so we need to try as294       hard as possible to return an actual value, or the user295       will get a TypeError.296 297c�L<�\V\4'd	S!W4#\V\4'dS!V\V44#\V\4'dS!\V4V4#S'd)\V\4'dS!\V4V4#\298#rx)r;rr8r>�complex�NotImplemented)rr�b�fallback_operator�handle_complex�monomorphic_operators&&���r�forward�-Fraction._operator_fallbacks.<locals>.forward�s}����!�X�&�&�+�A�1�1��A�s�#�#�+�A�x��{�;�;��A�u�%�%�(��q��1�5�5��J�q�'�$:�$:�(��q��1�5�5�%�%r�__c�p<�\V\P4'dS!\V4V4#\V\P4'dS!\V4\V44#S'd<\V\P4'dS!\V4\V44#\#rx)	r;r<r=r�Realr>�Complexr�r�)r�rrr�r�r�s&&���r�reverse�-Fraction._operator_fallbacks.<locals>.reverse�s{����!�W�-�-�.�.�+�H�Q�K��;�;��A�w�|�|�,�,�(��q��5��8�<�<��J�q�'�/�/�$B�$B�(����U�1�X�>�>�%�%r�__r)rW�__doc__)r�r�r�r�r�sfff  r�_operator_fallbacks�Fraction._operator_fallbackshsg���b299	&� �"3�"<�"<�<�t�C���.�6�6���		&�!�#4�#=�#=�=��D���.�6�6�����rc��VPVPr2VPVPrT\P!W54pV^8Xd0\PW%,W4,,W5,4#W6,pW%V,,WG,,p\P!W�4p	V	^8Xd\PW�V,4#\PW�,WuV	,,4#)za + b�r9r:rFrGrrO�300rrr��na�da�nb�dbrK�s�t�g2s301&&        r�_add�
Fraction._add������q�~�~�B����q�~�~�B��H�H�R�����6��.�.�r�w���/@�"�'�J�J��G����'�N�R�V�#��
�X�X�a�^��
��7��.�.�q�b�&�9�9��*�*�1�7�A�r��N�C�Crc��VPVPr2VPVPrT\P!W54pV^8Xd0\PW%,W4,,302W5,4#W6,pW%V,,WG,,303p\P!W�4p	V	^8Xd\PW�V,4#\PW�,WuV	,,4#)za - br�r�s304&&        r�_sub�
Fraction._sub*r�rc�V�VPVPr2VPVPrT\P!W%4pV^8�dW&,pWV,p\P!WC4pV^8�dWG,pW7,p\PW$,WS,4#)za * br�)rrr�r�r�r�r��g1r�s&&      r�_mul�
Fraction._mul:s}�����q�~�~�B����q�~�~�B�
�X�X�b�
��
��6��I�B��I�B�
�X�X�b�
��
��6��I�B��I�B��*�*�2�7�B�G�<�<rc��VPVPr2V^8Xd\RV,4hVPVPrT\P!WB4pV^8�dWF,pW&,p\P!W54pV^8�dWW,pW7,pWC,W%,r�V	^8dV)V	)r�\305P
W�4#)za / br4)r9r:rErFrGrrO)306rrr�r�r�r�r�r�r�rrs307&&        r�_div�
Fraction._divJs������q�~�~�B�
��7�#�$5��$:�;�;����q�~�~�B�
�X�X�b�
��
��6��I�B��I�B�
�X�X�b�
��
��6��I�B��I�B��w���1��q�5��2��r�q��*�*�1�0�0rc��VPVP,VPVP,,#)za // b)rr�rrr�s&&r�	_floordiv�Fraction._floordiv`s'�����a�m�m�+�������1L�M�MrFc��VPVPr2\VPV,W!P,4wrEV\WRV,43#)z(a // b, a % b))rrrr)rrr�r�r��div�n_mods&&    r�_divmod�Fraction._divmodfsC������
�
�B��A�K�K�"�,�b�;�;�.>�?�308���H�U��G�,�,�,rc��VPVPr2\VPV,VPV,,W#,4#)za % b)rrr)rrr�r�r�s&&  r�_mod�
Fraction._modns7������
�
�B�����r�)�a�k�k�B�.>�?���I�Irc�(�Ve\#\V\P4'Ed5VP^8XEdVP309pV^8�d9\PVPV,VPV,4#VP^8�d;\PVPV),VPV),4#VP^8Xd%\RVPV),,4h\PVP)V),VP)V),4#\V4\V4,#\V\\34'd\V4V,#\#)z�a ** b310 311If b is not an integer, the result will be a float or complex312since roots are generally irrational. If b is an integer, the313result will be rational.314 315r4)
r�r;r<r=rrrrOr9r:rEr>r�)rrr��modulo�powers&&& r�__pow__�Fraction.__pow__usJ����!�!��a��)�)�*�*��}�}��!������A�:�#�6�6�q�|�|�u�7L�78�~�~��7N�P�P��\�\�A�%�#�6�6�q�~�~�%��7O�78�|�|��v�7M�O�O��\�\�Q�&�+�,=�,-�N�N�u�f�,D�-E�F�F�$�6�6�����U�F�7R�9:���
�5�&�7P�R�R�316�Q�x�5��8�+�+�
��E�7�+�
,�
,���8�q�=� �!�!rc�v�Ve\#VP^8Xd$VP^8�dWP,#\V\P3174'd(\
VPVP4V,#VP^8XdWP,#V\V4,#)za ** b)318r�r:r9r;r<r=rrrr>)r�rrrs&&&r�__rpow__�Fraction.__rpow__�s�����!�!��>�>�Q��1�<�<�1�#4����$�$��a��)�)�*�*��A�K�K����7�1�<�<��>�>�Q�����$�$��E�!�H�}�rc�V�\PVPVP4#)z++a: Coerces a subclass instance to Fraction�rrOr9r:rys&r�__pos__�Fraction.__pos__�s���*�*�1�<�<����H�Hrc�X�\PVP)VP4#)z-arrys&r�__neg__�Fraction.__neg__�s���*�*�A�L�L�=�!�.�.�I�Irc�h�\P\VP4VP4#)zabs(a))rrOrr9r:rys&r�__abs__�Fraction.__abs__�s"���*�*�3�q�|�|�+<�a�n�n�M�Mrc��VP^8d&V!VP)VP,)4#V!VPVP,4#)zint(a)ri)rr�_indexs&&r�__int__�Fraction.__int__�sC���<�<�!���Q�\�\�M�Q�^�^�;�<�=�=��!�,�,�!�.�.�8�9�9rc��VP^8d VP)VP,)#VPVP,#)z
math.trunc(a)rirys&r�	__trunc__�Fraction.__trunc__�s9���<�<�!���l�l�]�a�n�n�4�5�5��<�<�1�>�>�1�1rc�<�VPVP,#)z
math.floor(a)rirys&r�	__floor__�Fraction.__floor__�s���|�|�q�~�~�-�-rc�@�VP)VP,)#)zmath.ceil(a)rirys&r�__ceil__�Fraction.__ceil__�s���,�,��!�.�.�0�1�1rc�|�VfeVPp\VPV4wr4V^,V8dV#V^,V8�d319V^,#V^,^8XdV#V^,#^320\V4,pV^8�d\	\W,4V4#\	\W,4V,4#)z/round(self, ndigits)321 322Rounds half toward even.323)r:rr9rr�round)rI�ndigitsr�floor�	remainder�shifts&&    r�	__round__�Fraction.__round__�s���324�?��!�!�A�%�d�o�o�q�9��E��1�}�q� ����Q���"��q�y� ����a�����q�y� ��C��L� ���Q�;��E�$�,�/��7�7��E�$�,�/�%�7�8�8rc�B�\VPVP4#)z325hash(self))rr9r:res&r�__hash__�Fraction.__hash__�s���t����0A�0A�B�Brc�z�\V4\Jd'VPV8H;'dVP^8H#\	V\326P4'd;VPVP8H;'dVPVP8H#\	V\327P4'dVP^8Xd
VPp\	V\4'dQ\P!V4'g\P!V4'dRV8H#WP!V48H#\"#)za == b�)r7r8r9r:r;r<r=rrr��imag�realr>rF�isnan�isinfrYr�r�s&&r�__eq__�Fraction.__eq__�s�����7�c�>��<�<�1�$�<�<����1�)<�<��a��)�)�*�*��L�L�A�K�K�/�4�4��N�N�a�m�m�3�
5��a����)�)�a�f�f��k����A��a�����z�z�!�}�}��328�329�1�
�
��a�x���L�L��O�+�+�"�!rc��\V\P4'd@V!VPVP,VP330VP,4#\V\4'dY\P!V4'g\P!V4'd331V!RV4#V!WPV44#\#)a3Helper for comparison operators, for internal use only.332 333Implement comparison between a Rational instance `self`, and334either another Rational instance or a float `other`.  If335`other` is not a Rational instance or a float, return336NotImplemented. `op` should be one of the six standard337comparison operators.338 339r-)
r;r<r=r9rr:rr>rFr0r1rYr�)rI�other�ops&&&r�_richcmp�Fraction._richcmp�s����e�W�-�-�.�.��d�o�o��(9�(9�9��'�'�%�/�/�9�;�
;��e�U�#�#��z�z�%� � �D�J�J�u�$5�$5��#�u�~�%��$���� 6�7�7�!�!rc�B�VPV\P4#)za < b)r7�operator�ltr�s&&r�__lt__�Fraction.__lt__����z�z�!�X�[�[�)�)rc�B�VPV\P4#)za > b)r7r:�gtr�s&&r�__gt__�Fraction.__gt__r>rc�B�VPV\P4#)za <= b)r7r:�ler�s&&r�__le__�Fraction.__le__r>rc�B�VPV\P4#)za >= b)r7r:�ger�s&&r�__ge__�Fraction.__ge__r>rc�,�\VP4#)za != 0)r�r9rys&r�__bool__�Fraction.__bool__#s���A�L�L�!�!rc�J�VPVPVP33#rx)rLr9r:res&r�340__reduce__�Fraction.__reduce__+s ��������$�2C�2C� D�E�Erc�z�\V4\8XdV#VPVPVP4#rx�r7rrLr9r:res&r�__copy__�Fraction.__copy__.�.����:��!��K��~�~�d�o�o�t�/@�/@�A�Arc�z�\V4\8XdV#VPVPVP4#rxrR)rI�memos&&r�__deepcopy__�Fraction.__deepcopy__3rUr)r:r9ri)rlN)i@B)Trx)NrW�341__module__�__qualname__�__firstlineno__r��	__slots__r6�classmethodrQrYr^rOrfr+ru�propertyrrrr�r�r�r�r�r�r:�add�__add__�__radd__r��sub�__sub__�__rsub__r��mul�__mul__�__rmul__r��truediv�__truediv__�__rtruediv__r��floordiv�__floordiv__�
__rfloordiv__r�r�342__divmod__�__rdivmod__r�mod�__mod__�__rmod__rrrrr�indexrrrrr'r*r2r7r<rArErIrLrOrSrX�__static_attributes__�__classdictcell__�
__classcell__)rL�
__classdict__s@@rrr�s�����(/�I�i�V�B��B�*�=��=��	?��	?��	��	�&�4�7A�r��������C�343B� )�Df)�P344�"l �dD�,�D�(�,�,�?��G�X�D�,�D�(�,�,�?��G�X�=�,�D�(�,�,�?��G�X�1�(!4�D�(�:J�:J� K��K��N�#6�i��AR�AR�TY�"Z��L�-�-�2�'�6�5�I��J��J�345,�D�(�,�,��F��G�X� "�D� I�J�N�#�.�.�:�2�.�2�3469�4C�"�*"�,*�*�*�*�"�F�B�347B�Bri@)F)r��	functoolsrFr<r:�re�sys�__all__�	hash_info�modulusr	�infr
�	lru_cacher�compile�VERBOSE�348IGNORECASEr@rr(�DOTALL�	fullmatchr�r�r=rr�rr�<module>r�s��6�����	�349��,��350�-�-�'�'���m�m����351���w�'�*�(�*�@�:�:���Z�Z�"�-�-��!��"�:$'�P)+�352�353�
4��Y�Y�����
)�'�Y�&�$')�j�j�2�&�Y�Y�����''�&'�Y�'$�,@B�w���@Br
codekingpro/portable-devtools · Team Ai