403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python315/Lib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/__pycache__/_pydecimal.cpython-315.opt-1.pyc
R
>lqj+�c��Qs,QMQMQMQMQMQMQMQMQ	MQ
MQMQMQ
MQMQMQMQMQMQMQMQMQMQMQMQMQMQMQMQMQMQMQ MQ!MQ"MQ#MQ$MQ%MQ&MQ'MQ(Ms\sQ)sQ*sQ+s]PHs]PH s	]PH(s
]Q,H.Gs
\
QQ-Q)Q.5sQsQsQsQsQsQsQsQsP	sP	s\
O4Qx6Xc
Q0sQ0sQysQ1sLQ2sQ2sQzsQ3s\\]*
*
sQ4Q\ 2s!Q5Q\!2s"Q6Q	\!2s#Q7Q\#2s$Q8Q
\!\%2s&Q9Q\#2s'Q:Q\#\%2s(Q;Q\!2s)Q<Q\#2s*Q=Q\!2s+Q>Q
\!2s,Q?Q\)\+2s-Q@Q\)\+\,2s.QAQ\!\/2s0\"\&\)\-\+\.\#\,\0,	s1\$\#\'\#\(\#\*\#-s2\\\\\\\\1s3]PH�s4\4OjQB2s6\7,Q{N2s8QCs9QDs:?4Q|QEks;QFs<QGQ\=2s>Q}QHks?\	O�O�\>2QIQJ\=2sBQKQ\=2sCQLQM\=2sDQ~QNksE\FO�sHQOsIQPsJQQsKQRsLQQSksMQTsNQUsOQVQW\=2sP\P2O�sRQQXksSQYsTQZsUQ[]dQ\]FQ]]5Q^](Q_]Q`]Qa]Qb]
Qc]-	1QdksVQ�QeksWQ}QfksX\C]\\&\-\#,,QgQ�]]Qh5sY\C]	\\&\-\#\"\.,,Qi5sZ\C]	\,,Qi5s[]PCHps\\\O�Qj\\O�\\O�*2O�sa\\O�Qk2O�sb\\O�Ql2O�sc\\O�Qm\\O�\\O�*2se?\]PCH�sgQ|QnkshQosiQpsjQ�QqkskQrslQssm\>Qt2sn\>Qu2so\>Qv2sp\>]2sq\>]2sr\>P2ss\n\o1st\
O�O�sw\
O�O�sy\
O�O�s{\|]
\w]*
\w2s}?
Qws~P!\cQ/sCK{h9h\cK�h9h)�z Python decimal arithmetic module�Decimal�Context�DecimalTuple�DefaultContext�BasicContext�ExtendedContext�DecimalException�Clamped�InvalidOperation�DivisionByZero�Inexact�Rounded�	Subnormal�Overflow�	Underflow�FloatOperation�DivisionImpossible�InvalidContext�ConversionSyntax�DivisionUndefined�
ROUND_DOWN�
ROUND_HALF_UP�ROUND_HALF_EVEN�
ROUND_CEILING�ROUND_FLOOR�ROUND_UP�ROUND_HALF_DOWN�
ROUND_05UP�
setcontext�
getcontext�localcontext�IEEEContext�MAX_PREC�MAX_EMAX�MIN_EMIN�	MIN_ETINY�IEEE_CONTEXT_MAX_BITS�HAVE_THREADS�HAVE_CONTEXTVAR�SPEC_VERSION�decimalz1.70z2.4.2)�
namedtuplezsign digits exponent)�modulec��U!�N�)�argss*�C:\Python315\\Lib\_pydecimal.py�<lambda>r1Fs���l��N�Zo�i@�T�c�,`�\sQs]dsnQsQsQsUsP!)ra�Base exception class.

Used exceptions derive from this.
If an exception derives from another exception besides this (such as
Underflow (Inexact, Rounded, Subnormal)) that indicates that it is only
called if the others are present.  This isn't actually used for
anything, though.

handle  -- Called when context._raise_error is called and the
           trap_enabler is not set.  First argument is self, second is
           the context.  More arguments can be given, those being after
           the explanation in _raise_error (For example,
           context._raise_error(NewError, '(-x)!', self._sign) would
           call NewError().handle(context, self._sign).)

To define a new exception, it should be sufficient to have it derive
from DecimalException.
c��P!r-r.��self�contextr/s&&*r0�handle�DecimalException.handlews��r2r.��__name__�
__module__�__qualname__�__firstlineno__�__doc__r:�__static_attributes__�__classdictcell__��
__classdict__s@r0rrds�����$
�
r2c��\sQs]{sQsQsP!)ra	Exponent of a 0 changed to fit bounds.

This occurs and signals clamped if the exponent of a result has been
altered in order to fit the constraints of a specific concrete
representation.  This may occur when the exponent of a zero result would
be outside the bounds of a representation, or when a large normal
number would have an encoded exponent that cannot be represented.  In
this latter case, the exponent is reduced to fit and the corresponding
number of zero digits are appended to the coefficient ("fold-down").
r.�r=r>r?r@rArBr.r2r0rr{���	r2c�,`�\sQs]�snQsQsQsUsP!)r	a�An invalid operation was performed.

Various bad things cause this:

Something creates a signaling NaN
-INF + INF
0 * (+-)INF
(+-)INF / (+-)INF
x % 0
(+-)INF % x
x._rescale( non-integer )
sqrt(-x) , x > 0
0 ** 0
x ** (non-integer)
x ** (+-)INF
An operand is invalid

The result of the operation after this is a quiet positive NaN,
except when the cause is a signaling NaN, in which case the result is
also a quiet NaN, but with the original sign, and an optional
diagnostic information.
c��U%cB[U]*OU]*OQP	2oUOU2![!)��n)�_dec_from_triple�_sign�_int�_fix_nan�_NaN)r8r9r/�anss&&* r0r:�InvalidOperation.handle�s9���"�4��7�=�=�$�q�'�,�,��T�J�C��<�<��(�(��r2r.r<rDs@r0r	r	�s�����,�r2c�,`�\sQs]�snQsQsQsUsP!)rz�Trying to convert badly formed string.

This occurs and signals invalid-operation if a string is being
converted to a number and it does not conform to the numeric string
syntax.  The result is [0,qNaN].
c��[!r-�rQr7s&&*r0r:�ConversionSyntax.handle�����r2r.r<rDs@r0rr�s������r2c�,`�\sQs]�snQsQsQsUsP!)r
a�Division by 0.

This occurs and signals division-by-zero if division of a finite number
by zero was attempted (during a divide-integer or divide operation, or a
power operation with negative right-hand operand), and the dividend was
not zero.

The result of the operation is [sign,inf], where sign is the exclusive
or of the signs of the operands for divide, or is 1 for an odd power of
-0, for power.
c��[U*!r-)�_SignedInfinity�r8r9�signr/s&&&*r0r:�DivisionByZero.handle�s
���t�$�$r2r.r<rDs@r0r
r
�s����
�%�%r2c�,`�\sQs]�snQsQsQsUsP!)rz�Cannot perform the division adequately.

This occurs and signals invalid-operation if the integer result of a
divide-integer or remainder operation had too many digits (would be
longer than precision).  The result is [0,qNaN].
c��[!r-rVr7s&&*r0r:�DivisionImpossible.handle�rXr2r.r<rDs@r0rr��������r2c�,`�\sQs]�snQsQsQsUsP!)rz�Undefined result of division.

This occurs and signals invalid-operation if division by zero was
attempted (during a divide-integer, divide, or remainder operation), and
the dividend is also zero.  The result is [0,qNaN].
c��[!r-rVr7s&&*r0r:�DivisionUndefined.handle�rXr2r.r<rDs@r0rr�rbr2c��\sQs]�sQsQsP!)ra�Had to round, losing information.

This occurs and signals inexact whenever the result of an operation is
not exact (that is, it needed to be rounded and any discarded digits
were non-zero), or if an overflow or underflow condition occurs.  The
result in all cases is unchanged.

The inexact signal may be tested (or trapped) to determine if a given
operation (or sequence of operations) was inexact.
r.rGr.r2r0rr�rHr2c�,`�\sQs]�snQsQsQsUsP!)ra�Invalid context.  Unknown rounding, for example.

This occurs and signals invalid-operation if an invalid context was
detected during an operation.  This can occur if contexts are not
checked on creation and either the precision exceeds the capability of
the underlying concrete representation or an unknown or unsupported
rounding was specified.  These aspects of the context need only be
checked when the values are required to be used.  The result is
[0,qNaN].
c��[!r-rVr7s&&*r0r:�InvalidContext.handle�rXr2r.r<rDs@r0rr�s����	��r2c��\sQs]�sQsQsP!)ra�Number got rounded (not  necessarily changed during rounding).

This occurs and signals rounded whenever the result of an operation is
rounded (that is, some zero or non-zero digits were discarded from the
coefficient), or if an overflow or underflow condition occurs.  The
result in all cases is unchanged.

The rounded signal may be tested (or trapped) to determine if a given
operation (or sequence of operations) caused a loss of precision.
r.rGr.r2r0rr�rHr2c��\sQs]�sQsQsP!)r
a�Exponent < Emin before rounding.

This occurs and signals subnormal whenever the result of a conversion or
operation is subnormal (that is, its adjusted exponent is less than
Emin, before any rounding).  The result in all cases is unchanged.

The subnormal signal may be tested (or trapped) to determine if a given
or operation (or sequence of operations) yielded a subnormal result.
r.rGr.r2r0r
r
�s��r2c�,`�\sQsQsnQsQsQsUsP!)r�a�Numerical overflow.

This occurs and signals overflow if the adjusted exponent of a result
(from a conversion or from an operation that is not an attempt to divide
by zero), after rounding, would be greater than the largest value that
can be handled by the implementation (the value Emax).

The result depends on the rounding mode:

For round-half-up and round-half-even (and for round-half-down and
round-up, if implemented), the result of the operation is [sign,inf],
where sign is the sign of the intermediate result.  For round-down, the
result is the largest finite number that can be represented in the
current precision, with the sign of the intermediate result.  For
round-ceiling, the result is the same as for round-down if the sign of
the intermediate result is 1, or is [0,inf] otherwise.  For round-floor,
the result is the same as for round-down if the sign of the intermediate
result is 0, or is [1,inf] otherwise.  In all cases, Inexact and Rounded
will also be raised.
c��UO[[[[17c[
U*!U]6XccUO[6Xc[
U*![UQUO*UOUO*
]*2!U]6XccUO[6Xc[
U*![UQUO*UOUO*
]*2!P!)rK�9)�roundingrrrrr[rrM�prec�Emaxrr\s&&&*r0r:�Overflow.handles������
�� /�� ;�;�"�4�(�(��1�9����=�0�&�t�,�,�#�D�#�g�l�l�*:�#�L�L����5�a�7�9�
9��1�9����;�.�&�t�,�,�#�D�#�g�l�l�*:�$�\�\�'�,�,�6�q�8�:�
:�r2r.r<rDs@r0rrs�����*
:�
:r2c��\sQsQsQsQsP!)r�,aTNumerical underflow with result rounded to 0.

This occurs and signals underflow if a result is inexact and the
adjusted exponent of the result would be smaller (more negative) than
the smallest value that can be handled by the implementation (the value
Emin).  That is, the result is both inexact and subnormal.

The result after an underflow will be a subnormal number rounded, if
necessary, so that its exponent is not less than Etiny.  This may result
in 0 with the sign of the intermediate result and an exponent of Etiny.

In all cases, Inexact, Rounded, and Subnormal will also be raised.
r.rGr.r2r0rr,s��r2c��\sQsQsQsQsP!)r�;auEnable stricter semantics for mixing floats and Decimals.

If the signal is not trapped (default), mixing floats and Decimals is
permitted in the Decimal() constructor, context.create_decimal() and
all comparison operators. Both conversion and comparisons are exact.
Any occurrence of a mixed operation is silently recorded by setting
FloatOperation in the context flags.  Explicit conversions with
Decimal.from_float() or context.create_decimal_from_float() do not
set the flag.

Otherwise (the signal is trapped), only equality comparisons and
explicit conversions are silent.  All other mixed operations raise
FloatOperation.
r.rGr.r2r0rr;s��
r2�decimal_contextc��[O2![c%[2o[O	S2St!h9h)z�Returns this thread's context.

If this thread does not yet have a context, returns
a new context and sets this thread's context.
New contexts are copies of DefaultContext.
)�_current_context_var�get�LookupErrorr�set�r9s r0rrfs?���#�'�'�)�)�����)��� � ��)����s��	A�"A�Ac��U[[[17c!UO2oUO	2[
O
U2P!)z%Set this thread's context to context.)rrr�copy�clear_flagsrzr}r~s&r0rrts6���>�<��A�A��,�,�.���������W�%r2c���Ue[2o[U2oUO2FD5vq4U[7c[	QUQ02g[UOV42J7	U!)a�Return a context manager for a copy of the supplied context

Uses a copy of the current context if no context is specified
The returned context manager creates a local decimal context
in a with statement:
    def sin(x):
         with localcontext() as ctx:
             ctx.prec += 2
             # Rest of sin calculation algorithm
             # uses a precision 2 greater than normal
         return +s  # Convert result to normal precision

     def sin(x):
         with localcontext(ExtendedContext):
             # Rest of sin calculation algorithm
             # uses the Extended Context from the
             # General Decimal Arithmetic Specification
         return +s  # Convert result to normal context

>>> setcontext(DefaultContext)
>>> print(getcontext().prec)
28
>>> with localcontext():
...     ctx = getcontext()
...     ctx.prec += 2
...     print(ctx.prec)
...
30
>>> with localcontext(ExtendedContext):
...     print(getcontext().prec)
...
9
>>> print(getcontext().prec)
28
�'z2' is an invalid keyword argument for this function)r�_ContextManager�items�_context_attributes�	TypeError�setattr�new_context)�ctx�kwargs�ctx_manager�key�values&,   r0rr}sc��H�{��l��!�#�&�K��l�l�n�
���)�)��a��u�$V�W�X�X���'�'��4�%��r2c��U]6:fU[6�fU] *%c[Q[02g[2o]	U] **]*
Um]]U]*]***Um]UO*
Um[Um]Um[O[P
2UmU!)z�
Return a context object initialized to the proper values for one of the
IEEE interchange formats.  The argument must be a multiple of 32 and less
than IEEE_CONTEXT_MAX_BITS.
z5argument must be a multiple of 32, with a maximum of )
r%�
ValueErrorrrqrr�Eminrrp�clamp�dict�fromkeys�_signals�traps)�bitsr�s" r0r r �s����q�y�D�0�0�D�2�I�I��.�.C�-D�F�G�	G��)�C��D�"�H�~��!�C�H��A�$��(�Q�,�'�(�C�H��3�8�8�|�C�H�"�C�L��C�I��
�
�h��.�C�I��Jr2c�B`�\sQsQsnQsQ{sQ|Qks\Q2s\Q2s	Qs
QsQ}QksQ	s
Q
sQsQ~QksQ~Q
ksQ~QksQ~QksQ~QksQ~QksQsQsQsQsQQksQ~QksQ~QksQ~QksQ�QksQ~Qks\s Q~Qks!Q~Qks"Q~Qks#\#s$Q~Qks%Q s&Q~Q!ks'Q~Q"ks(Q~Q#ks)Q~Q$ks*Q~Q%ks+Q~Q&ks,Q~Q'ks-Q~Q(ks.Q)s/Q*s0\0s1\2Q+2s3\2Q,2s4Q-s5Q.s6Q/s7Q0s8Q1s9Q2s:Q3s;Q4s<Q5s=Q6s>Q7s?Q8s@\A\9\:\;\<\=\>\?\@Q95sBQ~Q:ksCQ;sDQ<sEQ~Q=ksFQ~Q>ksGQ?sHQ}Q@ksIQ}QAksJQ~QBksKQ}QCksLQ~QDksMQEsNQFsOQ}QGksPQ}QHksQ\QsRQ~QIksSQ~QJksTQ~QKksUQLsVQMsWQNsXQOsYQ~QPksZQ~QQks[Q~QRks\QSs]QTs^Q~QUks_Q~QVks`QWsaQXsbQYscQZsdQ~Q[kseQ\sfQ]sgQ^shQ~Q_ksiQ`sjQaskQ~QbkslQcsmQ~QdksnQ~QeksoQfspQgsqQ~QhksrQ~QikssQ~QjkstQ~QkksuQ~QlksvQ~QmkswQ~QnksxQ~QoksyQ~QpkszQ~Qqks{Qrs|Q~Qsks}Q~Qtks~Q~QuksQvs�Qws�Qxs�Q}Qyks�Qzs�Us�P!)�r��z,Floating-point class for decimal arithmetic.c�
�[OU2o[U[2%Cc�[	UO2O
QP22oUe,Ue[2oUO[QU*2!UOQ2Q6Xc	]UmL]UmUOQ2oUdUOQ29%fPo[UOQ29%fQ2o[[VV*22Um
U[U2*
UmP
UmU!UOQ	2oUdZ[[S9%fQ22O#Q2Um
UOQ
2%c	QUmLQUmLQUm
Q
UmP	UmU![U[2%c@U]6�c	]UmL]Um]Um[[%U22Um
P
UmU![U[&2%cGUOUmUOUmUOUm
UO UmU![U[(2%cOUO*Um[UO2Um
[UO,2UmP
UmU![U[.[012%Cc�[U2]6wc[3Q2g[U]*[2%cU]*Q7f[3Q2gU]*UmU]*Q
6XcQUm
U]*UmP	UmU!,o	U]*FDXo
[U
[2%c7]S
t96:c]	6:c(LL$U	%fU
]6wcU	O5U
2JMJO[3Q2g	U]*Q7c<PO7[9[U	22Um
U]*UmP	UmU![U]*[2%cGPO7[9[S	9%f],22Um
U]*UmP
UmU![3Q2g[U[:2%c�Ue[2oUO[<Q2[&O?U2oUOUmUOUmUOUm
UO UmU![AQU*2g)a�Create a decimal point instance.

>>> Decimal('3.14')              # string input
Decimal('3.14')
>>> Decimal((0, (3, 1, 4), -2))  # tuple (sign, digit_tuple, exponent)
Decimal('3.14')
>>> Decimal(314)                 # int
Decimal('314')
>>> Decimal(Decimal(314))        # another decimal instance
Decimal('314')
>>> Decimal('  3.14  \n')        # leading and trailing whitespace okay
Decimal('3.14')
�_zInvalid literal for Decimal: %rr]�-�int�frac�exp�0�diag�signal�NrL�FztInvalid tuple size in creation of Decimal from list or tuple.  The list or tuple should have exactly three elements.z|Invalid sign.  The first value in the tuple should be an integer; either 0 for a positive number or 1 for a negative number.zTThe second value in the tuple must be composed of integers in the range 0 through 9.zUThe third value in the tuple must be an integer, or one of the strings 'F', 'n', 'N'.�;strict semantics for mixing floats and Decimals are enabled�Cannot convert %r to Decimal�rK��rLr�)!�object�__new__�
isinstance�str�_parser�strip�replacer�_raise_errorr�grouprNr�rO�len�_exp�_is_special�lstrip�absr�_WorkRepr]r��list�tupler��append�join�map�floatr�
from_floatr�)�clsr�r9r8�m�intpart�fracpartr�r��digits�digits&&&        r0r��Decimal.__new__�se��.�~�~�c�"���e�S�!�!�����
�-�-�c�2�6�7�A��y��?�(�l�G��+�+�,<� A�E� I�K�K��w�w�v��#�%���
���
��g�g�e�n�G��"��7�7�6�?�0�0�b���!�'�'�%�.�/�/�C�0����G�$4� 5�6��	��#�h�-�/��	�#(�� ��K��w�w�v����#� #�C�����$4� 5� <� <�S� A�D�I��w�w�x�(�(�$'��	�$'��	�!$�D�I� #�D�I�#'�� ��K��e�S�!�!���z���
���
��D�I��C��J��D�I�$�D���K��e�W�%�%����D�I����D�J����D�I� %� 1� 1�D���K��e�X�&�&����D�J��E�I�I��D�I��E�I�I��D�I�$�D���K��e�d�5�\�*�*��5�z�Q�� �"G�H�H��u�Q�x��-�-�%��(�e�2C� �"O�P�P��q��D�J��Q�x�3����	�!�!�H��	�#'�� �6�K�1��"�1�X�X�E�!�%��-�-�!�u�/��/�!�U�a�Z�"�M�M�%�0�&0�)�*8�9�9�
&���8�z�)� "����C��(8� 9�D�I� %�a��D�I�'+�D�$��K� ��a��#�.�.� "����C����A�3�(?� @�D�I� %�a��D�I�',�D�$�
�K�%�&>�?�?�
�e�U�#�#���$�,��� � ���
��&�&�u�-�E����D�I����D�J����D�I� %� 1� 1�D���K��6��>�?�?r2c�z�[U[[[12%c	UU2![	QU*2g)aAConverts a real number to a decimal number, exactly.

>>> Decimal.from_number(314)              # int
Decimal('314')
>>> Decimal.from_number(0.1)              # float
Decimal('0.1000000000000000055511151231257827021181583404541015625')
>>> Decimal.from_number(Decimal('3.14'))  # another decimal instance
Decimal('3.14')
r�)r�r�rr�r�)r��numbers&&r0�from_number�Decimal.from_numberes3���f�s�G�U�3�4�4��v�;���6��?�@�@r2c�d�[U[2%c#U]6�c]L]o]o[[U22oL�[U[2%c�[
OU2%f[
OU2%cU[U22![
OQU2Q6Xc]oL]o[U2O2vqVUO2]*
o[U]U**2oL[Q2g[V$U'2oU[IcU!UU2!)a�Converts a float to a decimal number, exactly.

Note that Decimal.from_float(0.1) is not the same as Decimal('0.1').
Since 0.1 is not exactly representable in binary floating point, the
value is stored as the nearest representable value which is
0x1.999999999999ap-4.  The exact equivalent of the value in decimal
is 0.1000000000000000055511151231257827021181583404541015625.

>>> Decimal.from_float(0.1)
Decimal('0.1000000000000000055511151231257827021181583404541015625')
>>> Decimal.from_float(float('nan'))
Decimal('NaN')
>>> Decimal.from_float(float('inf'))
Decimal('Infinity')
>>> Decimal.from_float(-float('inf'))
Decimal('-Infinity')
>>> Decimal.from_float(-0.0)
Decimal('-0')

g�?zargument must be int or float.)r�r�r�r�r��_math�isinf�isnan�repr�copysign�as_integer_ratio�
bit_lengthr�rMr)r��fr]�k�coeffrL�d�results&&      r0r��Decimal.from_floatts���,�a�����Q��1�A�D��A���A��K�E�
��5�
!�
!��{�{�1�~�~����Q����4��7�|�#��~�~�c�1�%��,������q�6�*�*�,�D�A������"�A���!�Q�$��K�E��<�=�=�!�$��r�2���'�>��M��v�;�r2c�h�UO%cUOoUQ6Xc]!UQ6Xc]!]!)zRReturns whether the number is not actually one.

0 if a number
1 if NaN
2 if sNaN
rLr�)r�r�)r8r�s& r0�_isnan�Decimal._isnan�s0�������)�)�C��c�z������r2c�V�UOQ6XcUO%cP!]!]!)zYReturns whether the number is infinite

0 if finite or not a number
1 if +INF
-1 if -INF
r�)r�rN�r8s&r0�_isinfinity�Decimal._isinfinity�s$���9�9����z�z�z��	��r2c�^�UO2oUeP
oLUO2oU%f	U%cuUe[2oU]6XcUO[QU2!U]6XcUO[QU2!U%cUO	U2!UO	U2!]!)z�Returns whether the number is not actually one.

if self, other are sNaN, signal
if self, other are NaN return nan
return 0

Done before operations.
�sNaN)r�rr�r	rP)r8�otherr9�self_is_nan�other_is_nans&&&  r0�_check_nans�Decimal._check_nans�s����k�k�m���=� �L� �<�<�>�L��,���$�,���a���+�+�,<�f�(,�.�.��q� ��+�+�,<�f�(-�/�/���}�}�W�-�-��>�>�'�*�*�r2c���Ue[2oUO%fUO%c�UO2%cUO[QU2!UO2%cUO[QU2!UO2%cUO[QU2!UO2%cUO[QU2!]!)aVersion of _check_nans used for the signaling comparisons
compare_signal, __le__, __lt__, __ge__, __gt__.

Signal InvalidOperation if either self or other is a (quiet
or signaling) NaN.  Signaling NaNs take precedence over quiet
NaNs.

Return 0 if neither operand is a NaN.

zcomparison involving sNaNzcomparison involving NaN)rr��is_snanr�r	�is_qnan�r8r�r9s&&&r0�_compare_check_nans�Decimal._compare_check_nans�s����?� �l�G�����u�0�0�0��|�|�~�~��+�+�,<�,G�,0�2�2�������+�+�,<�,G�,1�3�3�������+�+�,<�,F�,0�2�2�������+�+�,<�,F�,1�3�3�r2c�J�UO9%fUOQ6g!)zeReturn True if self is nonzero; otherwise return False.

NaNs and infinities are considered nonzero.
r��r�rOr�s&r0�__bool__�Decimal.__bool__�s!��
���3�3�4�9�9��#3�3r2c��UO%fUO%c3UO2oUO2oV#6Xc]!V#6cP!]!U%fU%f]!PUO*'!U%fPUO*!UOUO6cP!UOUO6c]!UO2oUO2oVE6Xc�UOQUO
UO
*
**oUOQUO
UO
*
**oVg6Xc]!Vg6cPUO*'!PUO*!VE6�cPUO*!PUO*'!)z�Compare the two non-NaN decimal instances self and other.

Returns -1 if self < other, 0 if self == other and 1
if self > other.  This routine is for internal use only.r�)r�r�rN�adjustedrOr�)r8r��self_inf�	other_inf�
self_adjusted�other_adjusted�self_padded�other_paddeds&&      r0�_cmp�Decimal._cmps[������u�0�0�0��'�'�)�H��)�)�+�I��$���%��	������u�{�{�*�+�+������#�#��;�;����#��I��:�:����#���
�
��
����)���*��)�)�c�4�9�9�u�z�z�+A�&B�B�K� �:�:��U�Z�Z�$�)�)�-C�(D�D�L��*���+��d�j�j�(�(�(��T�Z�Z�'�'�
�
+�����#�#��4�:�:�%�&�&r2c��[VP	Q5vqU[IcU!UOV2%cP
!UOU2]6H!)T)�equality_op)�_convert_for_comparison�NotImplementedr�r�r�s&&&r0�__eq__�Decimal.__eq__EsE��-�d�t�L����N�"��L����E�+�+���y�y���1�$�$r2c��[V2vqU[IcU!UOV2oU%cP
!UOU2]6!�F�r�r�r�r��r8r�r9rRs&&& r0�__lt__�Decimal.__lt__M�E��-�d�:����N�"��L��&�&�u�6�����y�y���!�#�#r2c��[V2vqU[IcU!UOV2oU%cP
!UOU2]6*!rrrs&&& r0�__le__�Decimal.__le__V�E��-�d�:����N�"��L��&�&�u�6�����y�y���1�$�$r2c��[V2vqU[IcU!UOV2oU%cP
!UOU2]6�!rrrs&&& r0�__gt__�Decimal.__gt___rr2c��[V2vqU[IcU!UOV2oU%cP
!UOU2]6�!rrrs&&& r0�__ge__�Decimal.__ge__hrr2c���[UP	Q5oUO%fU%c.UO%cUOV2oU%cU![UO	U22!)z�Compare self to other.  Return a decimal value:

a or b is a NaN ==> Decimal('NaN')
a < b           ==> Decimal('-1')
a == b          ==> Decimal('0')
a > b           ==> Decimal('1')
��raiseit)�_convert_otherr�r�rr�rs&&& r0�compare�Decimal.compareqsW���u�d�3��
�����%�*;�*;�*;��"�"�5�2�C���
��t�y�y��'�(�(r2c��UO%clUO2%c[Q2gUO2%c[OU2!UO%c['![!UO]6�c[]
UO[2oL [[UO'[2o[UO2U*[*oU]6�cSLU'oUP6XcQ!S!)zx.__hash__() <==> hash(x)z"Cannot hash a signaling NaN value.���)r�r�r��is_nanr��__hash__rN�_PyHASH_INFr��pow�_PyHASH_MODULUS�
_PyHASH_10INVr�rO)r8�exp_hash�hash_rRs&   r0r�Decimal.__hash__�s��������|�|�~�~�� D�E�E���������t�,�,��:�:�:�'�<�'�&�&��9�9��>��2�t�y�y�/�:�H��=�4�9�9�*�o�F�H��D�I�I���)�O�;���q�y�e�u�f���B�Y�r�'�C�'r2c	��[UO[[[UO
22UO2!)zURepresents the number as a triple tuple.

To show the internals exactly as they are.
)rrNr�r�r�rOr�r�s&r0�as_tuple�Decimal.as_tuple�s+��
�D�J�J��c�#�t�y�y�.A�(B�D�I�I�N�Nr2c�n�UO%c-UO2%c[Q2g[Q2gU%fQ![	UO
2oUO]6�cU]
UO**]q!L�UO'oU]6�c#U]*]6XcU]*oU]*oJ)UO'o[V'*O2]*
U2oU%cV*oVE*o]U*U*oUO%cU'oV1!)aGExpress a finite Decimal instance in the form n / d.

Returns a pair (n, d) of integers.  When called on an infinity
or NaN, raises OverflowError or ValueError respectively.

>>> Decimal('3.14').as_integer_ratio()
(157, 50)
>>> Decimal('-123e5').as_integer_ratio()
(-12300000, 1)
>>> Decimal('0.00').as_integer_ratio()
(0, 1)

z#cannot convert NaN to integer ratioz(cannot convert Infinity to integer ratior�)
r�rr��
OverflowErrorr�rOr��minr�rN)r8rLr��d5�d2�shift2s&     r0r��Decimal.as_integer_ratio�s��������{�{�}�}� �!F�G�G�#�$N�O�O���K�
��	�	�N���9�9��>��r�4�9�9�}�$�a�q��)�)��B��q�&�Q��U�a�Z��a����a����)�)��B��!�b�&�,�,�.��2�B�7�F���������2����A��:�:�:���A��t�r2c�(�Q[U2*!)z0Represents the number as an instance of Decimal.z
Decimal('%s'))r�r�s&r0�__repr__�Decimal.__repr__�s����T��*�*r2c��PQ,UO*oUO%c`UOQ6Xc
UQ*!UOQ6XcUQ*UO*!UQ*UO*!UO[	UO2*oUO]6:cUQ6�cSoLKU%f]oL@UOQ6XcU]*]*]*
oLU]*
]*]*oU]6:c&QoQQU'**UO*oLvU[	UO26�c8UOQU[	UO2*
**oPoL%UOPUoQUOUP*oVE6XcPoL7Ue[2oQ	Q
,UO*QVE*
**oV6*U*U*!)
z�Return string representation of the number in scientific notation.

Captures all of the information in the underlying representation.
r�r��InfinityrL�NaNr�r��.�e�Ez%+d���)rNr�r�rOr�r�capitals)	r8�engr9r]�
leftdigits�dotplacer�r�r�s	&&&      r0�__str__�Decimal.__str__�s����C�y����$�������y�y�C���j�(�(����c�!��e�|�d�i�i�/�/��f�}�t�y�y�0�0��Y�Y��T�Y�Y��/�
�
�9�9��>�j�2�o�!�H���H�
�Y�Y�#�
�"�Q��!�+�a�/�H�#�Q��!�+�a�/�H��q�=��G��S�8�)�_�,�t�y�y�8�H�
��T�Y�Y��
'��i�i��X�c�$�)�)�n�%<� =�=�G��H��i�i�	��*�G��T�Y�Y�x�y�1�1�H��!��C���$�,����*�W�-�-�.��*�:M�1N�N�C��~��(�3�.�.r2c�*�UOP	UQ5!)aConvert to a string, using engineering notation if an exponent is needed.

Engineering notation has an exponent which is a multiple of 3.  This
can leave up to 3 digits to the left of the decimal place and may
require the addition of either one or two trailing zeros.
)r8r9)r;�r8r9s&&r0�
to_eng_string�Decimal.to_eng_strings���|�|��g�|�6�6r2c��UO%cUOUQ5oU%cU!Ue[2oU%f'UO[6wcUO2oLUO
2oUOU2!)zBReturns a copy with the sign switched.

Rounds, if it has reason.
r~)r�r�rrpr�copy_abs�copy_negate�_fix�r8r9rRs&& r0�__neg__�Decimal.__neg__sq��
�����"�"�7�"�3�C���
��?� �l�G���(�(�K�7��-�-�/�C��"�"�$�C��x�x�� � r2c��UO%cUOUQ5oU%cU!Ue[2oU%f'UO[6wcUO2oL[
U2oUOU2!)zXReturns a copy, unless it is a sNaN.

Rounds the number (if more than precision digits)
r~)r�r�rrprrBrrDrEs&& r0�__pos__�Decimal.__pos__.sj��
�����"�"�7�"�3�C���
��?� �l�G���(�(�K�7��-�-�/�C��$�-�C��x�x�� � r2c��U%fUO2!UO%cUOUQ5oU%cU!UO%cUO	UQ5oU!UOUQ5oU!)z�Returns the absolute value of self.

If the keyword argument 'round' is false, do not round.  The
expression self.__abs__(round=False) is equivalent to
self.copy_abs().
r~)rBr�r�rNrFrI)r8�roundr9rRs&&& r0�__abs__�Decimal.__abs__Csq����=�=�?�"������"�"�7�"�3�C���
��:�:�:��,�,�w�,�/�C��
��,�,�w�,�/�C��
r2c��[U2oU[IcU!Ue[2oUO%fUO%c�UO	V2oU%cU!UO2%cSUOUO6wc-UO2%cUO[Q2![U2!UO2%c[U2![UOUO2o]oUO[6XcUOUO6wc]oU%fSU%fK[UOUO2oU%c]o[UQU2oUOU2oU!U%f\[!VAOUO"*
]*
2oUO%VBO2oUOU2oU!U%f\[!V@OUO"*
]*
2oUO%VBO2oUOU2oU!['U2o['U2o[)VxUO"2vqx['2o	UO*UO*6wc�UO,UO,6Xc![UQU2oUOU2oU!UO,UO,6cX�q�UO*]6Xc,]U	mUO*UO*tUmUmL7]U	mL/UO*]6Xc]U	m]]tUmUmL]U	mUO*]6Xc$UO,UO,*U	mL"UO,UO,*
U	mUO.U	m[U	2oUOU2oU!)zRReturns self + other.

-INF + INF (or the reverse) cause InvalidOperation errors.
z
-INF + INFr�)rr�rr�r�r�rNr�r	rr(r�rprrMrD�maxrq�_rescaler��
_normalizer]r�r�)
r8r�r9rRr��negativezeror]�op1�op2r�s
&&&       r0�__add__�Decimal.__add__Ys���
�u�%���N�"��L��?� �l�G�����u�0�0�0��"�"�5�2�C���
����!�!��:�:����,��1B�1B�1D�1D�"�/�/�0@�,�O�O��t�}�$�� � �"�"��u�~�%��$�)�)�U�Z�Z�(�������{�*�t�z�z�U�[�[�/H��L��E��t�z�z�5�;�;�/�D����"�4��c�2�C��(�(�7�#�C��J���c�:�:����4�Q�6�7�C��.�.��&6�&6�7�C��(�(�7�#�C��J���c�9�9�w�|�|�3�A�5�6�C��-�-��%5�%5�6�C��(�(�7�#�C��J��t�n���u�o���c����5�������8�8�s�x�x���w�w�#�'�'�!�&�|�S�#�>���h�h�w�'���
��w�w���� ��S��x�x�1�}����%(�X�X�s�x�x�"���#�(����
�X�X��]��F�K�"#�Q��C�H�c�h��F�K��8�8�q�=����3�7�7�*�F�J����3�7�7�*�F�J��W�W��
��f�o���h�h�w����
r2c���[U2oU[IcU!UO%fUO%cUOVQ5oU%cU!UO	UO2UQ5!)zReturn self - otherr~)rr�r�r�rVrCrs&&& r0�__sub__�Decimal.__sub__�si���u�%���N�"��L�����u�0�0�0��"�"�5�"�:�C���
��|�|�E�-�-�/��|�A�Ar2c�V�[U2oU[IcU!UOVQ5!)zReturn other - selfr~)rr�rYr�s&&&r0�__rsub__�Decimal.__rsub__�s*���u�%���N�"��L��}�}�T�}�3�3r2c�@�[U2oU[IcU!Ue[2oUOUO*oUO%fUO%c�UOV2oU%cU!UO
2%c,U%fUO[Q2![U*!UO
2%c,U%fUO[Q2![U*!UOUO*oU%c	U%f![UQU2oUOU2oU!UOQ6Xc*[V1OU2oUOU2oU!UOQ6Xc*[V0OU2oUOU2oU![U2o[U2o[U[UO UO *2U2oUOU2oU!)zLReturn self * other.

(+-) INF * 0 (or its reverse) raise InvalidOperation.
z(+-)INF * 0z0 * (+-)INFr��1)rr�rrNr�r�r�r�r	r[r�rMrDrOr�r�r�)r8r�r9�
resultsignrR�	resultexprTrUs&&&     r0�__mul__�Decimal.__mul__�s���
�u�%���N�"��L��?� �l�G��Z�Z�%�+�+�-�
�����u�0�0�0��"�"�5�2�C���
����!�!��"�/�/�0@�-�P�P�&�z�2�2�� � �"�"��"�/�/�0@�-�P�P�&�z�2�2��I�I��
�
�*�	��5�"�:�s�I�>�C��(�(�7�#�C��J��9�9���"�:�z�z�9�E�C��(�(�7�#�C��J��:�:���"�:�y�y�)�D�C��(�(�7�#�C��J��t�n���u�o���z�3�s�w�w����/@�+A�9�M���h�h�w����
r2c��[U2oU[Ic[!Ue[2oUOUO*oUO%fUO%c�UOV2oU%cU!UO
2%c-UO
2%cUO[Q2!UO
2%c[U*!UO
2%c2UO[Q2[UQUO22!U%f6U%fUO[Q2!UO[QU2!U%f"UOUO*
o]oCLO[!UO"2[!UO"2*
UO$*]*oUOUO*
U*
o['U2o['U2o	U]6�c2[)UO*]
U**U	O*2vqjL1[)UO*U	O*]
U'**2vqjU
%cU]*]6Xc
U]*
oLEUOUO*
oV[6c#U]
*]6XcU]
*oU]*
oJ([U[-U2U2oUO/U2!)zReturn self / other.z(+-)INF/(+-)INFzDivision by infinityr�z0 / 0zx / 0)rr�rrNr�r�r�r�r	r[rrM�Etinyrr
r�r�rOrqr��divmodr�r�rD)r8r�r9r]rRr�r��shiftrTrU�	remainder�	ideal_exps&&&         r0�__truediv__�Decimal.__truediv__s?���u�%���N�"�!�!��?� �l�G��z�z�E�K�K�'������u�0�0�0��"�"�5�2�C���
����!�!�e�&7�&7�&9�&9��+�+�,<�>O�P�P����!�!�&�t�,�,�� � �"�"��$�$�W�.D�E�'��c�7�=�=�?�C�C����+�+�,=�w�G�G��'�'����F�F���)�)�e�j�j�(�C��E���
�
�O�c�$�)�)�n�4�w�|�|�C�a�G�E��)�)�e�j�j�(�5�0�C��4�.�C��5�/�C���z�#)�#�'�'�B��I�*=�s�w�w�#G� ��y�#)�#�'�'�3�7�7�R�%��Z�3G�#H� ����1�9��>��Q�J�E��!�I�I��
�
�2�	��o�%�"�*��/��b�L�E��1�H�C��t�S��Z��5���x�x�� � r2c�,�UOUO*oUO2%cUOoL [UOUO2oUO	2UO	2*
oU%cUO2%fUQ6:c)[UQ]2UO
VBO21!VRO6:Cc[U2o[U2oUOUO6�c=U9O]
UOUO*
**tmL;U9O]
UOUO*
**tm[UOUO2vq�U]
UO*6c7[U[U2]2[UO[U	2U21!UO[Q2o
V�1!)z�Return (self // other, self % other), to context.prec precision.

Assumes that neither self nor other is a NaN, that self is not
infinite and that other is nonzero.
r�z%quotient too large in //, % or divmodr)rNr�r�r(r�rMrQrprqr�r�r�rfr�r�r)r8r�r9r]ri�expdiffrTrU�q�rrRs&&&        r0�_divide�Decimal._divide;s}���z�z�E�K�K�'��������	�	�I��D�I�I�u�z�z�2�I��-�-�/�E�N�N�$4�4���u�(�(�*�*�g��m�$�T�3��2��M�M�)�-=�-=�>�@�
@��l�l�"��4�.�C��5�/�C��w�w�#�'�'�!����2����#�'�'� 1�2�2�����2����#�'�'� 1�2�2���#�'�'�3�7�7�+�D�A��2�w�|�|�#�#�(��s�1�v�q�9�(����S��V�Y�G�I�I��"�"�#5�#J�L���x�r2c�V�[U2oU[IcU!UOVQ5!)z)Swaps self/other and returns __truediv__.r~)rr�rjr�s&&&r0�__rtruediv__�Decimal.__rtruediv__\s-���u�%���N�"��L�� � �� �7�7r2c��[U2oU[IcU!Ue[2oUOV2oU%cV31!UOUO*oUO2%cSUO2%cUO
[Q2oV31![U*UO
[Q21!U%fOU%fUO
[Q2oV31!UO
[QU2UO
[Q21!UOV2vqVUOU2oVV1!)z&
Return (self // other, self % other)
zdivmod(INF, INF)�INF % xzdivmod(0, 0)�x // 0�x % 0)
rr�rr�rNr�r�r	r[rr
rprD)r8r�r9rRr]�quotientrhs&&&    r0�
__divmod__�Decimal.__divmod__cs-���u�%���N�"��L��?� �l�G����u�.����:���z�z�E�K�K�'�������� � �"�"��*�*�+;�=O�P���x��'��-��,�,�-=�y�I�K�K����*�*�+<�n�M���x���,�,�^�X�t�L��,�,�-=�w�G�I�I�#�l�l�5�:����N�N�7�+�	��"�"r2c�V�[U2oU[IcU!UOVQ5!)z(Swaps self/other and returns __divmod__.r~)rr�rzr�s&&&r0�__rdivmod__�Decimal.__rdivmod__�s-���u�%���N�"��L������6�6r2c��[U2oU[IcU!Ue[2oUOV2oU%cU!UO	2%cUO[Q2!U%f5U%cUO[Q2!UO[Q2!UOV2]*oUOU2oU!)z
self % other
rvrxz0 % 0)
rr�rr�r�r�r	rrprD)r8r�r9rRrhs&&&  r0�__mod__�Decimal.__mod__�s����u�%���N�"��L��?� �l�G����u�.����J�������'�'�(8�)�D�D����+�+�,<�g�F�F��+�+�,=�w�G�G��L�L��0��3�	��N�N�7�+�	��r2c�V�[U2oU[IcU!UOVQ5!)z%Swaps self/other and returns __mod__.r~)rr�r�r�s&&&r0�__rmod__�Decimal.__rmod__�s*���u�%���N�"��L��}�}�T�}�3�3r2c�H�Ue[2o[UP	Q5oUOV2oU%cU!UO2%cUO	[
Q2!U%f5U%cUO	[
Q2!UO	[Q2!UO2%c[U2oUOU2![UOUO2oU%f)[UOQU2oUOU2!UO2UO2*
oVRO]*6�cUO	[2!UQ6:c-UO!VBO"2oUOU2![%U2o[%U2oUO&UO&6�c=U9O(]
UO&UO&*
**tmL;U9O(]
UO&UO&*
**tm[+UO(UO(2vq�]U	*U]**UO(6�cV�O(*o	U]*
oU]
UO*6�cUO	[2!UOo
U	]6c
]U
*
o
U	'o	[U
[-U	2U2oUOU2!)z9
Remainder nearest to 0-  abs(remainder-near) <= other/2
rzremainder_near(infinity, x)zremainder_near(x, 0)zremainder_near(0, 0)r�r)rrr�r�r�r	rrrDr(r�rMrNr�rqrrQrpr�r�r�rfr�)r8r�r9rR�ideal_exponentrmrTrUrnror]s&&&        r0�remainder_near�Decimal.remainder_near�su���?� �l�G��u�d�3�����u�.����J�������'�'�(8�(E�G�
G����+�+�,<�,B�D�D��+�+�,=�,B�D�D�������$�-�C��8�8�G�$�$��T�Y�Y��
�
�3���"�4�:�:�s�N�C�C��8�8�G�$�$��-�-�/�E�N�N�$4�4���l�l�Q�&�&��'�'�(:�;�;��b�=��-�-��0@�0@�A�C��8�8�G�$�$��t�n���u�o���7�7�c�g�g���G�G�r�C�G�G�c�g�g�-�.�.�G��G�G�r�C�G�G�c�g�g�-�.�.�G��c�g�g�s�w�w�'���
�Q�3�!�A�#�;���� �
���L�A�
��F�A���G�L�L� � ��'�'�(:�;�;��z�z���q�5��T�6�D���A��t�S��V�^�<���x�x�� � r2c�8�[U2oU[IcU!Ue[2oUOV2oU%cU!UO	2%cUUO	2%cUO[Q2![UOUO**!U%fQU%c3UO[QUOUO*2!UO[Q2!UOV2]*!)z
self // otherz
INF // INFrwz0 // 0)rr�rr�r�r�r	r[rNr
rrprs&&& r0�__floordiv__�Decimal.__floordiv__�s����u�%���N�"��L��?� �l�G����u�.����J������� � �"�"��+�+�,<�l�K�K�&�t�z�z�E�K�K�'?�@�@����+�+�N�H�,0�J�J����,D�F�F��+�+�,=�x�H�H��|�|�E�+�A�.�.r2c�V�[U2oU[IcU!UOVQ5!)z*Swaps self/other and returns __floordiv__.r~)rr�r�r�s&&&r0�
__rfloordiv__�Decimal.__rfloordiv__s-���u�%���N�"��L��!�!�$�!�8�8r2c���UO2%c9UO2%c[Q2gUO%cQLQoL[	U2o[U2!)zFloat representation.z%Cannot convert signaling NaN to floatz-nan�nan)r�r�r�rNr�r��r8�ss& r0�	__float__�Decimal.__float__sE���;�;�=�=��|�|�~�~� �!H�I�I��*�*�*��%�A��D�	�A��Q�x�r2c���UO%cCUO2%c[Q2gUO2%c[	Q2gPUO
*oUO]6�c5U[UO2*]
UO**!S[UOPUO9%fQ2*!)z1Converts self to an int, truncating if necessary.zCannot convert NaN to integerz"Cannot convert infinity to integerr�)	r�r�r�r�r'rNr�r�rOr�s& r0�__int__�Decimal.__int__(s��������{�{�}�}� �!@�A�A��!�!�#�#�#�$H�I�I�
�$�*�*����9�9��>��S����^�#�B��	�	�M�1�1��S����:�D�I�I�.�5�5�#�6�6�6r2c��U!r-r.r�s&r0�real�Decimal.real7s���r2c��[]2!�rK�rr�s&r0�imag�Decimal.imag;s���q�z�r2c��U!r-r.r�s&r0�	conjugate�Decimal.conjugate?s���r2c�,�[[U22!r-)�complexr�r�s&r0�__complex__�Decimal.__complex__Bs���u�T�{�#�#r2c��UOoUOUO*
o[U2U6�cFU[U2U*
PO	Q2o[UOV OP	2![U2!)z2Decapitate the payload of a NaN to fit the contextr�)	rOrqr�r�r�rMrNr�r)r8r9�payload�max_payload_lens&&  r0rP�Decimal._fix_nanEsm���)�)��"�,�,����6���w�<�/�)��c�'�l�?�:�;�<�C�C�C�H�G�#�D�J�J����D�I�I��t�}�r2c���UO%c3UO2%cUOU2![U2!UO	2oUO2oU%f�UOU,UO*o[[UOU2U2oVPO6wc-UO[2[UOQU2![U2![UO 2UO*UO"*
oVc6�cNUO[$QUO2oUO[&2UO[(2U!Vb6oU%cSoUOU6Cc�[UO 2UO*U*
o	U	]6c![UOQU]*
2o]o	UO*UO,*o
U
V	2oUO PU	9%fQoU]6�cD[/[1U2]*2o[U2UO"6�cUPPoU]*
oVc6�c#UO[$QUO2oL[UOV�2oU%cU%cUO[22U%cUO[42U%cUO[&2UO[(2U%fUO[2U!U%cUO[42UO]6XchUOU6�cWUO[2UO QUOU*
**o
[UOV�2![U2!)z�Round if it is necessary to keep self within prec precision.

Rounds and fixes the exponent.  Does not raise on a sNaN.

Arguments:
self - Decimal instance
context - context used.
r��
above Emaxr_)r�r�rPrre�Etoprrr�r(rPr�r�rrMrNr�rOrqrrr�_pick_rounding_functionrpr�r�rr
)r8r9rer��exp_max�new_exp�exp_minrR�self_is_subnormalr��rounding_method�changedr�r�s&&            r0rD�Decimal._fixQs��������{�{�}�}��}�}�W�-�-��t�}�$��
�
����|�|�~����|�|�T�*�7�=�=�9�G��#�d�i�i��/��9�G��)�)�#��$�$�W�-�'��
�
�C��A�A��t�}�$��d�i�i�.�4�9�9�,�w�|�|�;���>��&�&�x��t�z�z�J�C�� � ��)�� � ��)��J�#�O����G��9�9�w������^�d�i�i�/�'�9�F���z�'��
�
�C����C����"�:�:�7�;K�;K�L�O�%�d�3�G��I�I�g�v�&�-�-�#�E���{��C��J�q�L�)���u�:����,�!�#�2�J�E��q�L�G��~��*�*�8�\�4�:�:�N��&�t�z�z�5�B���,��$�$�Y�/� ��$�$�Y�/���$�$�W�-�� � ��)���$�$�W�-��J��� � ��+��=�=�A��$�)�)�d�"2�� � ��)��)�)�c�4�9�9�t�+;�&<�<�K�#�D�J�J��B�B��t�}�r2c�D�[UOU2%c]!P!)z(Also known as round-towards-0, truncate.)�
_all_zerosrO�r8rqs&&r0�_round_down�Decimal._round_down�s���d�i�i��&�&���Ir2c�(�UOU2'!)zRounds away from 0.)r�r�s&&r0�	_round_up�Decimal._round_up�s��� � ��&�&�&r2c�x�UOU*Q7c]![UOU2%c]!P!)zRounds 5 up (away from 0)�56789)rOr�r�s&&r0�_round_half_up�Decimal._round_half_up�s.���9�9�T�?�g�%��
��	�	�4�
(�
(���Ir2c�b�[UOU2%cP!UOU2!)zRound 5 down��_exact_halfrOr�r�s&&r0�_round_half_down�Decimal._round_half_down�s)���t�y�y�$�'�'��I��&�&�t�,�,r2c��[UOU2%c)U]6Xf UOU]*
*Q7cP!UOU2!)z!Round 5 to even, rest to nearest.�02468r�r�s&&r0�_round_half_even�Decimal._round_half_even�sD���t�y�y�$�'�'����d�i�i��Q��/�7�:��I��&�&�t�,�,r2c�n�UO%cUOU2!UOU2'!)z(Rounds up (not away from 0 if negative.)�rNr�r�s&&r0�_round_ceiling�Decimal._round_ceiling�s0���:�:�:��#�#�D�)�)��$�$�T�*�*�*r2c�n�UO%fUOU2!UOU2'!)z'Rounds down (not towards 0 if negative)r�r�s&&r0�_round_floor�Decimal._round_floor�s0���z�z�z��#�#�D�)�)��$�$�T�*�*�*r2c��U%c1UOU]*
*Q7cUOU2!UOU2'!)z)Round down unless digit prec-1 is 0 or 5.�05)rOr�r�s&&r0�_round_05up�Decimal._round_05up�s>���D�I�I�d�1�f�%�T�1��#�#�D�)�)��$�$�T�*�*�*r2)rrrrrrrrc�F�UdA[U[2%f[Q2g[]QU'2oUO	U2!UO
%c-UO
2%c[Q2g[Q2g[UO][22!)a�Round self to the nearest integer, or to a given precision.

If only one argument is supplied, round a finite Decimal
instance self to the nearest integer.  If self is infinite or
a NaN then a Python exception is raised.  If self is finite
and lies exactly halfway between two integers then it is
rounded to the integer with even last digit.

>>> round(Decimal('123.456'))
123
>>> round(Decimal('-456.789'))
-457
>>> round(Decimal('-3.0'))
-3
>>> round(Decimal('2.5'))
2
>>> round(Decimal('3.5'))
4
>>> round(Decimal('Inf'))
Traceback (most recent call last):
  ...
OverflowError: cannot round an infinity
>>> round(Decimal('NaN'))
Traceback (most recent call last):
  ...
ValueError: cannot round a NaN

If a second argument n is supplied, self is rounded to n
decimal places using the rounding mode for the current
context.

For an integer n, round(self, -n) is exactly equivalent to
self.quantize(Decimal('1En')).

>>> round(Decimal('123.456'), 0)
Decimal('123')
>>> round(Decimal('123.456'), 2)
Decimal('123.46')
>>> round(Decimal('123.456'), -2)
Decimal('1E+2')
>>> round(Decimal('-Infinity'), 37)
Decimal('NaN')
>>> round(Decimal('sNaN123'), 0)
Decimal('NaN123')

z+Second argument to round should be integralr_�cannot round a NaN�cannot round an infinity)r�r�r�rM�quantizer�rr�r'rQr)r8rLr�s&& r0�	__round__�Decimal.__round__�s���^
�=��a��%�%�� M�N�N�"�1�c�A�2�.�C��=�=��%�%������{�{�}�}� �!5�6�6�#�$>�?�?��4�=�=��O�4�5�5r2c��UO%c-UO2%c[Q2g[Q2g[	UO][22!)z�Return the floor of self, as an integer.

For a finite Decimal instance self, return the greatest
integer n such that n <= self.  If self is infinite or a NaN
then a Python exception is raised.

r�r�)r�rr�r'r�rQrr�s&r0�	__floor__�Decimal.__floor__8sI�������{�{�}�}� �!5�6�6�#�$>�?�?��4�=�=��K�0�1�1r2c��UO%c-UO2%c[Q2g[Q2g[	UO][22!)z�Return the ceiling of self, as an integer.

For a finite Decimal instance self, return the least integer n
such that n >= self.  If self is infinite or a NaN then a
Python exception is raised.

r�r�)r�rr�r'r�rQrr�s&r0�__ceil__�Decimal.__ceil__GsI�������{�{�}�}� �!5�6�6�#�$>�?�?��4�=�=��M�2�3�3r2c	��[UP	Q5o[UP	Q5oUO%fUO%Cc9Ue[2oUOQ6XcUO	[
QU2!UOQ6XcUO	[
QU2!UOQ6XcSoCL>UOQ6XcSoCL)UOQ6XcHU%fUO	[
Q2![UOUO**oL�UOQ6XcGU%fUO	[
Q2![UOUO**oLy[UOUO*[[UO2[UO2*2UOUO*2oWOV#2!)a
Fused multiply-add.

Returns self*other+third with no rounding of the intermediate
product self*other.

self and other are multiplied together, with no rounding of
the result.  The third operand is then added to the result,
and a single final rounding is performed.
rr�r�rLr�zINF * 0 in fmaz0 * INF in fma)
rr�rr�r�r	r[rNrMr�r�rOrV)r8r��thirdr9�products&&&& r0�fma�Decimal.fmaVs����u�d�3���u�d�3������u�0�0�0���$�,���y�y�C���+�+�,<�f�d�K�K��z�z�S� ��+�+�,<�f�e�L�L��y�y�C�������s�"������c�!��"�/�/�0@�0@�B�B�)�$�*�*�u�{�{�*B�C�����s�"��"�/�/�0@�0@�B�B�)�$�*�*�u�{�{�*B�C���&�t�z�z�E�K�K�'?�'*�3�t�y�y�>�C��
�
�O�+K�'L�'+�y�y�5�:�:�'=�?�G����u�.�.r2c��[U2oU[IcU![U2oU[IcU!Ue[2oUO2oUO2oUO2oU%fU%f	U%c�U]6XcUO	[
QU2!U]6XcUO	[
QU2!U]6XcUO	[
QU2!U%cUO
U2!U%cUO
U2!UO
U2!UO2%c-UO2%cUO2%fUO	[
Q2!U]6cUO	[
Q2!U%fUO	[
Q2!UO2UO6�cUO	[
Q2!U%fU%fUO	[
Q2!UO2%c]oLUOo[[U22o[UO22o[UO22o	UOU*[!]
UO"U2*U*o[%U	O"2FDo
[!U]
U2oJ	[!V�OU2o['U[)U2]2!)z!Three argument version of __pow__r�z@pow() 3rd argument not allowed unless all arguments are integerszApow() 2nd argument cannot be negative when 3rd argument specifiedzpow() 3rd argument cannot be 0zSinsufficient precision: pow() 3rd argument must not have more than precision digitszXat least one of pow() 1st argument and 2nd argument must be nonzero; 0**0 is not defined)rr�rr�r�r	rP�
_isintegerr�rq�_isevenrNr�r�r��to_integral_valuerr��rangerMr�)r8r��modulor9r�r��
modulo_is_nanr]�base�exponent�is&&&&       r0�
_power_modulo�Decimal._power_modulo�s����u�%���N�"��L���'���^�#��M��?� �l�G��k�k�m���|�|�~���
�
��
��,�-��a���+�+�,<�f�(,�.�.��q� ��+�+�,<�f�(-�/�/���!��+�+�,<�f�(.�0�0���}�}�W�-�-���~�~�g�.�.��?�?�7�+�+����!�!�� � �"�"��!�!�#�#��'�'�(8�)L�M�
M��1�9��'�'�(8�)O�P�
P���'�'�(8�(H�J�
J�
�?�?�����,��'�'�(8�);�<�
<��T��'�'�(8�)>�?�
?��=�=�?�?��D��:�:�D��S��[�!����.�.�0�1���E�3�3�5�6�����6�!�C��D�H�H�f�$=�=��G���x�|�|�$�A��t�R��(�D�%��4���v�.����c�$�i��3�3r2c��[U2oUOUOqTU]
*]6XcU]
*oU]*
oJ"[U2oUOUOq�U]
*]6XcU]
*oU]*
oJ"U]6Xc�VW*oU]
*]6XcU]
*oU]*
oJ"U]6cP!U]
U**o	UO]6XcU	'o	UO	2%cHUO
]6Xc7UO[U2*o
[V�*
U]*
2oL]o[]QQU**V�*
2!UO]6XCc�U]
*oUQ7c�VD'*U6wcP![U2]*
o
U]]*]A*oU[[U226�cP![V�*U2o
[VW*U2oU
dUeP!V�6�cP!]U
*oL�U]6Xc�[U2]*]A*o
[]U
*U2vqOU%cP!U]*]6XcU]*oU
]*o
J"U]
*]*oU[[U226�cP![V�*U2o
[VW*U2oU
dUeP!V�6�cP!]U
*oLP![U2o[U2U6�cP!U
'U*
o[]UU2!U]6�cU]
U**]ooL�U]6wc,[[[Vu*222U'6:cP![U2o[[[U2U*22U'6:cP!S]
U'*ooU]*U]*t96Xc]6XcLLU]*oU]*oJ4U]*U]*t96Xc]6XcLLU]*oU]*oJ4U]6�c�WU6:cP![UU2vooU]6wcP!][U2'U*'*o[UUU]*
*2vooUU6:cL UU]*
*U*U*oJFUU6XcU]6XfP!SoU]6�c!UU]d*[U2*6�cP!UU*oUU*o[U2o[U2U6�cP!UO	2%cQUO
]6Xc@UO[U2*o
[VZ*
U[U2*
2oL]o[]UQU**V[*
2!)a Attempt to compute self**other exactly.

Given Decimals self and other and an integer p, attempt to
compute an exact result for the power self**other, with p
digits of precision.  Return None if self**other is not
exactly representable in p digits.

Assumes that elimination of special cases has already been
performed: self and other must both be nonspecial; self must
be positive and not numerically equal to 1; other must be
nonzero.  For efficiency, other._exp should not be too large,
so that 10**abs(other._exp) is a feasible calculation.r_r�)����)r�r�r�r]r�rNr�r(rM�_nbitsr�r��_decimal_lshift_exactrfr��	_log10_lb)r8r��p�x�xc�xe�y�yc�yer�r��zeros�
last_digitr4�emaxrh�strxcr�rL�xc_bits�rem�arnro�str_xcs&&&                      r0�_power_exact�Decimal._power_exact�s���t
�T�N��������B��2�g��l��2�I�B��!�G�B��U�O��������B��2�g��l��2�I�B��!�G�B���7��H�B��r�'�Q�,��r�	���a����A�v���B��F�{�H��v�v��{�$�9�����!�!�e�k�k�Q�&6�!%���3�u�:�!5���H�3�Q�q�S�9����#�A�s�S��Y����G�G�
�6�6�Q�;��b��J��Y�&���8�r�>���2�J�q�L��6��t�R�x����S��Y��'��*�!�&�"�5��*�2�7�B�7���9��
���8����T���q���2�J�r�M�2�%�� &�q�!�t�R� 0�
�����1�f��k��1�H�B���F�A�
��t�Q�w����S��Y��'��)�!�&�"�5��*�2�7�B�7���9��
���8����T�����G�E��5�z�A�~����B��B�#�A�u�b�1�1���7��b�"�f�9�a�q�A�q��Q�w�3�s�3�r�u�:��/�B�3�6���R�j�G��3�s�2�w�w��'�(�R�C�/���r�R�C�y�q�A��a�%�1�q�5�%�A�%��a����a����a�%�1�q�5�%�A�%��a����a���
�q�5��!�|���R��m�G�B���a�x����r�
�{�A�~�&�&�A���b�!�a��c�(�+���1���6���A�a�C��1��q�(�A���F�q�A�v���B���6�a�!�C�%��2��.�.��
��U��
�a����R����v�;��?��
�����%�+�+��"2�!�Y�Y�s�5�z�1�N���)�1�S��[�=�9�E��E���6�#�e�)�#3�R�X�>�>r2c�R
�UdUOVU2![U2oU[IcU!Ue[2oUO	V2oU%cU!U%f%U%fUO[Q2![!]oUO]6Xc^UO2%cUO2%f]oLU%cUO[Q2!UO2oU%f,UO]6Xc[UQ]2![U*!UO2%c,UO]6Xc[U*![UQ]2!U[6XCcUO2%c�UO]6Xc]oL(VO6�cUOoL[!U2oUO"U*oU]UO*
6c)]UO*
oUO[$2L=UO[&2UO[$2]UO*
o[UQQU'**U2!UO)2oUO2%c2UO]6HU]66Xc[UQ]2![U*!PoP
o	UO+2UO)2*o
U]6�UO]6H6XcCU
[-[/UO0226�c[UQUO0]*2oL>UO32oU
[-[/U'226�c[UQU]*
2oUeQUO5VO]*2oUd+U]6Xc"[]UO6UO"2oP	o	Ue�UOo[9U2o
U
O U
O:q�[9U2oUO UO:ooUO<]6XcU'o]o[?V�UUUU*2vooU]]
[-[/U22U*
]*
***%cLU]*
oJb[U[/U2U2oU	%Cc�UO2%Cf�[-UO62UO6:cnUO]*[-UO62*
o[UOUO6QU**UO"U*
2oUOA2oUOC2[DFDo]UOFU$J	UOIU2oUO[&2UOJ[L*%cUO[N2UOJ[P*%c"UO[PQUO2[N[L[&[$[R1FD/oUOJU*%fJUOU2J1	U!UOIU2oU!)a�Return self ** other [ % modulo].

With two arguments, compute self**other.

With three arguments, compute (self**other) % modulo.  For the
three argument form, the following restrictions on the
arguments hold:

 - all three arguments must be integral
 - other must be nonnegative
 - either self or other (or both) must be nonzero
 - modulo must be nonzero and must have at most p digits,
   where p is the context precision.

If any of these restrictions is violated the InvalidOperation
flag is raised.

The result of pow(self, other, modulo) is identical to the
result that would be obtained by computing (self**other) %
modulo with unbounded precision, but is computed more
efficiently.  It is always exact.
z0 ** 0z+x ** y with x negative and y not an integerr�r_r�)*r�rr�rr�r�r	�_OnerNr�r�rCrMr[r�rqr�r�rrr��_log10_exp_boundr�r�rrrer
rOr�r�r]�_dpowerr�r�r�r�rD�flagsr
rrr)r8r�r�r9rR�result_sign�
multiplierr��self_adj�exact�boundrer�r�r�r�r�rr�extrar�rm�
newcontext�	exceptions&&&&                    r0�__pow__�Decimal.__pow__�sO��0���%�%�e�W�=�=��u�%���N�"��L��?� �l�G����u�.����J����+�+�,<�h�G�G������:�:��?����!�!��}�}���"#�K���"�/�/�0@�E�G�G��#�#�%�D���{�{�a��'��S�!�<�<�&�{�3�3�������{�{�a��&�{�3�3�'��S�!�<�<�
�4�<����!�!�
�;�;�!�#�!"�J��\�\�)�!(���J�!$�U��J��i�i�*�,����7�<�<��'��G�L�L�.�C��(�(��1���$�$�W�-��$�$�W�-�����n��#�K��S�#��X��s�C�C��=�=�?����������q� �h��l�3�'��S�!�<�<�&�{�3�3������%�%�'�%�.�.�*:�:����M�u�{�{�a�/�0���C����-�.�.�&�{�C����a��H����M�M�O�E���C���K�(�(�&�{�C��q��A���;��#�#�E�<�<�!�+;�<�C����!�#�*�1�c�h�h����A�C����;����A����A��U�U�A�E�E�����A��U�U�A�E�E��B��v�v��{��S���E��$�R�R��Q�u�W�=�
��s��A�b�3�s�5�z�?�1�#4�Q�#6�7�7�8�8����
��"�;��E�
�C�@�C��5��)�)�+�+��3�8�8�}����,�!�,�,��*�S����]�:��&�s�y�y�#�(�(�3�w�;�2F�'*�x�x��'7�9��!����J��"�"�$�%�X�	�./�
� � ��+�&��(�(�:�&�C�
�#�#�G�,����	�*�*��'�'�	�2�����)�)��$�$�X�|�S�Y�Y�G�&�	�7�G�W�L�	��#�#�I�.�.��(�(��3�M��
��(�(�7�#�C��
r2c�X�[U2oU[IcU!UOVUQ5!)z%Swaps self/other and returns __pow__.r~)rr�r)r8r�r�r9s&&&&r0�__rpow__�Decimal.__rpow__�	s,���u�%���N�"��L��}�}�T�7�}�;�;r2c�b�Ue[2oUO%cUOUQ5oU%cU!UOU2oUO	2%cU!U%f[UOQ]2!UOUO2,UO*o[UO2oUOoUOU]*
*Q6XcVd6cU]*
oU]*oJ9[UOUOPUU2!)z?Normalize- strip trailing 0s, change anything equal to 0 to 0e0r~r�)
rr�r�rDr�rMrNrrr�r�r�rOr�)r8r9rR�dupr��endr�s&&     r0�	normalize�Decimal.normalize�	s����?� �l�G������"�"�7�"�3�C���
��i�i�� ���?�?����J��#�C�I�I�s�A�6�6��<�<�����0����?���#�(�(�m���h�h���h�h�s�1�u�o��$����1�H�C��1�H�C���	�	�3�8�8�D�S�>�3�?�?r2c��[UP	Q5oUe[2oUe
UOoUO%fUO%c�UO	V2oU%cU!UO2%fUO2%cNUO2%c"UO2%c[
U2!UO[Q2!UO2UOt96:cUO6:fLUO[Q2!U%f3[UOQUO2oUOU2!UO2oVSO6�cUO[Q2!VQO*
]*UO 6�cUO[Q2!UO#UOU2oUO2UO6�cUO[Q2![%UO&2UO 6�cUO[Q2!U%c5UO2UO(6cUO[*2UOUO6�c1V@6wcUO[,2UO[.2UOU2oU!)zwQuantize self so its exponent is the same as that of exp.

Similar to self._rescale(exp._exp) but with error checking.
rzquantize with one INFz)target exponent out of bounds in quantizer�z9exponent of quantize result too large for current contextz7quantize result has too many digits for current context)rrrpr�r�r�rr�r	rer�rrrMrNrDr�rqrQr�rOr�r
rr)r8r�rpr9rRr�s&&&&  r0r��Decimal.quantize�	sU��
�S�$�/���?� �l�G����'�'�H�����s�����"�"�3�0�C���
���� � �D�$4�$4�$6�$6��?�?�$�$��)9�)9�);�);�"�4�=�(��+�+�,<�(?�A�A��
�
��3�8�8�;�w�|�|�;��'�'�(8�>�@�
@��"�4�:�:�s�C�H�H�=�C��8�8�G�$�$��
�
��
��<�<�'��'�'�(8�(c�e�
e��8�8�#�a�'�'�,�,�6��'�'�(8�(a�c�
c��m�m�C�H�H�h�/���<�<�>�G�L�L�(��'�'�(8�(c�e�
e��s�x�x�=�7�<�<�'��'�'�(8�(a�c�
c��3�<�<�>�G�L�L�0�� � ��+��8�8�d�i�i���{��$�$�W�-�� � ��)��h�h�w����
r2c�H�[UP	Q5oUO%fUO%cYUO29%cUO29%f)UO29%cUO2!UOUO6H!)a
Return True if self and other have the same exponent; otherwise
return False.

If either operand is a special value, the following rules are used:
   * return True if both operands are infinities
   * return True if both operands are NaNs
   * otherwise, return False.
r)rr�r�is_infiniter�r�s&&&r0�same_quantum�Decimal.same_quantum
s~���u�d�3������u�0�0�0��K�K�M�4�4�e�l�l�n�?�?��$�$�&�>�>�5�+<�+<�+>�
@��y�y�E�J�J�&�&r2c��UO%c[U2!U%f[UOQU2!UOU6�cA[UOUO
QUOU*
**U2![
UO
2UO*U*
oU]6c![UOQU]*
2o]oUOU*oUV2oUO
PU9%fQoU]6Xc[[U2]*2o[UOVa2!)a;Rescale self so that the exponent is exp, either by padding with zeros
or by truncating digits, using the given rounding mode.

Specials are returned without change.  This operation is
quiet: it raises no flags, and uses no information from the
context.

exp = exp to scale to (an integer)
rounding = rounding mode
r�r_)
r�rrMrNr�rOr�r�r�r�)r8r�rpr��
this_functionr�r�s&&&    r0rQ�Decimal._rescale
s�������4�=� ��#�D�J�J��S�9�9��9�9���#�D�J�J�(,�	�	�C����S��4I�(I�3�P�
P�
�T�Y�Y��$�)�)�+�c�1���A�:�#�D�J�J��S��U�;�D��F��4�4�X�>�
���-���	�	�'�6�"�)�)�c���a�<���E�
�1��%�E���
�
�E�7�7r2c�t�U]6:c[Q2gUO%f	U%f[U2!UOUO	2]*U*
U2oUO	2UO	26wc/UOUO	2]*U*
U2oU!)z�Round a nonzero, nonspecial Decimal to a fixed number of
significant figures, using the given rounding mode.

Infinities, NaNs and zeros are returned unaltered.

This operation is quiet: it raises no flags, and uses no
information from the context.

z'argument should be at least 1 in _round)r�r�rrQr�)r8�placesrprRs&&& r0�_round�Decimal._round5
s����Q�;��F�G�G�����4��4�=� ��m�m�D�M�M�O�A�-�f�4�h�?��
�<�<�>�T�]�]�_�,��,�,�s�|�|�~�a�/��6��A�C��
r2c��UO%c(UOUQ5oU%cU![U2!UO]6�c[U2!U%f[	UO
Q]2!Ue[
2oUe
UOoUO]U2oV06wcUO[2UO[2U!)a&Rounds to a nearby integer.

If no rounding mode is specified, take the rounding mode from
the context.  This method raises the Rounded and Inexact flags
when appropriate.

See also: to_integral_value, which does exactly the same as
this method except that it doesn't raise Inexact or Rounded.
r~r�)r�r�rr�rMrNrrprQr�rr�r8rpr9rRs&&& r0�to_integral_exact�Decimal.to_integral_exactL
s��������"�"�7�"�3�C���
��4�=� ��9�9��>��4�=� ��#�D�J�J��Q�7�7��?� �l�G����'�'�H��m�m�A�x�(���;�� � ��)����W�%��
r2c��Ue[2oUe
UOoUO%c(UOUQ5oU%cU![	U2!UO
]6�c[	U2!UO
]U2!)z@Rounds to the nearest integer, without raising inexact, rounded.r~)rrpr�r�rr�rQr1s&&& r0r��Decimal.to_integral_valuei
sv���?� �l�G����'�'�H������"�"�7�"�3�C���
��4�=� ��9�9��>��4�=� ��=�=��H�-�-r2c�f�Ue[2oUO%cOUOUQ5oU%cU!UO2%cUO]6Xc[U2!U%f:[
UOQUO]*2oUOU2!UO]6XcUO[Q2!UO]*o[U2oUO]*	oUO]*%c8UO]
*o[UO 2]*	]*oL/UOo[UO 2]*]*	oV7*
oU]6�cU]dU**oP	o	L[#U]dU'*2vqjU
%(o	VX*o]
U*oVk*oV�6:cLV�*]*	oJ!S	9%cV�*U6Ho	U	%c3U]6�cU]
U**oLU]
U'**oVX*
oLU]*]6Xc
U]*
o[
][%U2U2oUO'2oUO)[*2o
UOU2oV�mU!)zReturn the square root of self.r~r�zsqrt(-x), x > 0)rr�r�r�rNrrMr�rDr�r	rqr�r�r�r�rOrfr��
_shallow_copy�
_set_roundingrrp)r8r9rRrq�opr4�c�lrgrrhrLrnrps&&            r0�sqrt�Decimal.sqrt|
s)���?� �l�G������"�"�7�"�3�C���
����!�!�d�j�j�A�o��t�}�$��"�4�:�:�s�D�I�I��N�C�C��8�8�G�$�$��:�:��?��'�'�(8�:K�L�L�,�|�|�A�~���d�^���F�F�a�K��
�6�6�A�:�:������A��T�Y�Y��1�$��)�A����A��D�I�I��q� �A�%�A�����A�:�
��e��O�A��E�!�!�S�5�&�[�1�L�A�!�M�E�	�
��
��H�����A��v���E�Q�J���"�"�!�#��(�����z��b�%�i����R�%��Z���
�J�A��1�u��z��Q����q�#�a�&�!�,���'�'�)���(�(��9���h�h�w���#���
r2c��[UP	Q5oUe[2oUO%fUO%c�UO2oUO2oU%f	U%cPU]6XcU]6XcUO	U2!U]6XcU]6XcUO	U2!UOV2!UO
U2oU]6XcUOU2oUP6XcSoLSoUO	U2!)z�Returns the larger value.

Like max(self, other) except if one is not a number, returns
NaN (and signals if one is sNaN).  Also rounds.
r�rrr�r�rDr�r��
compare_total�r8r�r9�sn�onr:rRs&&&    r0rP�Decimal.max�
s����u�d�3���?� �l�G�����u�0�0�0�����B�����B��R���7�r�Q�w��9�9�W�-�-���7�r�Q�w� �:�:�g�.�.��'�'��7�7��I�I�e�����6��"�"�5�)�A���7��C��C��x�x�� � r2c��[UP	Q5oUe[2oUO%fUO%c�UO2oUO2oU%f	U%cPU]6XcU]6XcUO	U2!U]6XcU]6XcUO	U2!UOV2!UO
U2oU]6XcUOU2oUP6XcSoLSoUO	U2!)z�Returns the smaller value.

Like min(self, other) except if one is not a number, returns
NaN (and signals if one is sNaN).  Also rounds.
rr?rAs&&&    r0r(�Decimal.min	s����u�d�3���?� �l�G�����u�0�0�0�����B�����B��R���7�r�Q�w��9�9�W�-�-���7�r�Q�w� �:�:�g�.�.��'�'��7�7��I�I�e�����6��"�"�5�)�A���7��C��C��x�x�� � r2c��UO%cP
!UO]6�cP	!UOUOPoUQ[U2*6H!)z"Returns whether self is an integerr�)r�r�rOr�)r8�rests& r0r��Decimal._isinteger+sF��������9�9��>���y�y�����$���s�3�t�9�}�$�$r2c��U%cUO]6�cP	!UOPUO**Q7!)z:Returns True if self is even.  Assumes self is an integer.r�)r�rOr�s&r0r��Decimal._iseven4s.���t�y�y�1�}���y�y��D�I�I��&�'�1�1r2c��UO[UO2*]*
![c]!h9h)z$Return the adjusted exponent of self)r�r�rOr�r�s&r0r��Decimal.adjusted:s5��	��9�9�s�4�9�9�~�-��1�1���	��	�s�,0�	?�?�?c��U!)z�Returns the same Decimal object.

As we do not have different encodings for the same number, the
received object already is in its canonical form.
r.r�s&r0�	canonical�Decimal.canonicalBs	���r2c�x�[UP	Q5oUOV2oU%cU!UOVQ5!)z�Compares self to the other operand numerically.

It's pretty much like compare(), but all NaNs signal, with signaling
NaNs taking precedence over quiet NaNs.
rr~)rr�rrs&&& r0�compare_signal�Decimal.compare_signalJs9���u��5���&�&�u�6����J��|�|�E�|�3�3r2c��[UP	Q5oUO%cUO%f[!UO%fUO%c[!UOoUO	2oUO	2oU%f	U%c�VE6Xc}[UO2UO1o[UO2UO1oVg6cU%c[![!Vg6�cU%c[![![!U%c6U]6Xc[!U]6Xc[!U]6Xc[!U]6Xc[!L4U]6Xc[!U]6Xc[!U]6Xc[!U]6Xc[!V6c[!V6�c[!UOUO6cU%c[![!UOUO6�cU%c[![![!)z�Compares self to other using the abstract representations.

This is not like the standard compare, which use their numerical
value. Note that a total ordering is defined for all possible
abstract representations.
r)	rrN�_NegativeOner
r�r�rO�_Zeror�)r8r�r9r]�self_nan�	other_nan�self_key�	other_keys&&&     r0r@�Decimal.compare_totalVs����u�d�3���:�:�:�e�k�k�k����z�z�z�e�k�k�k��K��z�z���;�;�=���L�L�N�	��y��$��t�y�y�>�4�9�9�4����
�
�O�U�Z�Z�7�	��'��#��+�+��'��+�+�#������q�=�'�'���>��K��q�=�'�'���>��K�"��q�=��K���>�'�'��q�=��K���>�'�'��<����<��K��9�9�u�z�z�!����#�#��9�9�u�z�z�!��#�#����r2c��[UP	Q5oUO2oUO2oUOU2!)z�Compares self to other using abstract repr., ignoring sign.

Like compare_total, but with operand's sign ignored and assumed to
be 0.
r)rrBr@)r8r�r9r��os&&&  r0�compare_total_mag�Decimal.compare_total_mag�s6���u�d�3���M�M�O���N�N������q�!�!r2c�\�[]UOUOUO2!)z'Returns a copy with the sign set to 0. )rMrOr�r�r�s&r0rB�Decimal.copy_abs�s!����4�9�9�d�i�i��9I�9I�J�Jr2c���UO%c-[]UOUOUO2![]UOUOUO2!)z&Returns a copy with the sign inverted.)rNrMrOr�r�r�s&r0rC�Decimal.copy_negate�sI���:�:�:�#�A�t�y�y�$�)�)�T�=M�=M�N�N�#�A�t�y�y�$�)�)�T�=M�=M�N�Nr2c��[UP	Q5o[UOUOUOUO
2!)z$Returns self with the sign of other.r)rrMrNrOr�r�r�s&&&r0�	copy_sign�Decimal.copy_sign�s6���u�d�3������T�Y�Y� $�	�	�4�+;�+;�=�	=r2c��Ue[2oUOUQ5oU%cU!UO2P6Xc[!U%f[!UO2]6Xc[U2!UOoUO2oUO]6XcRU[[UO]*]*226�c![]QUO]*2oCL�UO]6Xc[U[[UO2']*]*226�c%[]QUO2]*
2oCL2UO]6Xc3VC'6c,[]QQU]*
**Q*U'2oL�UO]6Xc3VC']*
6c%[]QU]**U']*
2oL�[U2oUOUO qvUO"]6XcU'o]o[%VgV8*2vq�U	]]
[[U	22U*
]*
***%cLU]*
oJ^[][U	2U
2oUO'2oUO)[*2oUO-U2oV�mU!)zReturns e ** self.r~r_r�ro)rr�r�rVr
rrqr�rNr�r�rrrMrer�r�r�r]�_dexpr7r8rrDrp)r8r9rRr��adjr9r:r4rr�r�rps&&          r0r��Decimal.exp�s2���?� �l�G����w��/����J������#��L���K������"��4�=� �
�L�L���m�m�o���:�:��?�s�S��g�l�l�1�n�a�-?�)@�%A�A�"�1�c�7�<�<��>�:�C�
�Z�Z�1�_��s�3�����0@��0B�A�/E�+F�'G�!G�"�1�c�7�=�=�?�1�+<�=�C�
�Z�Z�1�_��r��"�1�c�C��1��I�o��&;�a�R�@�C�
�Z�Z�1�_��r�!�t��"�1�c�1�Q�3�i�!��A��6�C��$��B��6�6�2�6�6�q��w�w�!�|��B��
�E��"�1���1�
���A�b�3�s�5�z�?�1�#4�Q�#6�7�7�8�8����
��"�1�c�%�j�#�6�C��'�'�)���(�(��9���h�h�w���#���
r2c��P	!)z�Return True if self is canonical; otherwise return False.

Currently, the encoding of a Decimal instance is always
canonical, so this method returns True for any Decimal.
r.r�s&r0�is_canonical�Decimal.is_canonicals��r2c�&�UO%(!)z�Return True if self is finite; otherwise return False.

A Decimal instance is considered finite if it is neither
infinite nor a NaN.
)r�r�s&r0�	is_finite�Decimal.is_finites���#�#�#�#r2c�"�UOQ6H!)z8Return True if self is infinite; otherwise return False.r��r�r�s&r0r&�Decimal.is_infinite����y�y�C��r2c�"�UOQ7!)z>Return True if self is a qNaN or sNaN; otherwise return False.r�rrr�s&r0r�Decimal.is_nans���y�y�J�&�&r2c��UO%f	U%fP
!Ue[2oUOUO26*!)z?Return True if self is a normal number; otherwise return False.)r�rr�r�r>s&&r0�	is_normal�Decimal.is_normals4������4���?� �l�G��|�|�t�}�}��.�.r2c�"�UOQ6H!)z;Return True if self is a quiet NaN; otherwise return False.rLrrr�s&r0r��Decimal.is_qnan'rtr2c�"�UO]6H!)z8Return True if self is negative; otherwise return False.)rNr�s&r0�	is_signed�Decimal.is_signed+s���z�z�Q��r2c�"�UOQ6H!)z?Return True if self is a signaling NaN; otherwise return False.r�rrr�s&r0r��Decimal.is_snan/rtr2c��UO%f	U%fP
!Ue[2oUO2UO6!)z9Return True if self is subnormal; otherwise return False.)r�rr�r�r>s&&r0�is_subnormal�Decimal.is_subnormal3s4������4���?� �l�G��}�}�����-�-r2c�T�UO%(9%cUOQ6H!)z6Return True if self is a zero; otherwise return False.r�r�r�s&r0�is_zero�Decimal.is_zero;s"���#�#�#�8�8��	�	�S�(8�8r2c�r�UO[UO2*]*
oU]6�c*[[U]*]
*22]*
!UQ6:c1[[PU*
]*]
*22]*
![	U2oUO
UOqCU]6XcJ[U]
U'**
2o[U2o[U2[U2*
VV6*
!U[[]
U'*U*
22*]*
!)z�Compute a lower bound for the adjusted exponent of self.ln().
In other words, compute r such that self.ln() >= 10**r.  Assumes
that self is finite and positive and that self != 1.
r�r�r�rOr�r�r�r��r8rir9r:r4�num�dens&      r0�
_ln_exp_bound�Decimal._ln_exp_bound?s����i�i�#�d�i�i�.�(�1�,���!�8��s�3�r�6�2�:��'�!�+�+��"�9��s�B�s�F�B�;��?�+�,�q�0�0�
�d�^���v�v�r�v�v�1��!�8��a��Q�B��h�-�C��a�&�C��s�8�c�#�h�&�#�)�4�4��3�s�2��r�6�A�:��'�'�!�+�+r2c
�B�Ue[2oUOUQ5oU%cU!U%f[!UO2]6Xc[!U[
6Xc[!UO]6XcUO[Q2![U2oUOUOqTUOoV`O2*
]*o[VEU2oU]]
[![#[%U222U*
]*
***%cLU]*
oJ_['[U]62[#[%U22U'2oUO)2oUO+[,2o	UO/U2oV�mU!)z/Returns the natural (base e) logarithm of self.r~zln of a negative value)rr��_NegativeInfinityr��	_Infinityr
rVrNr�r	r�r�r�rqr��_dlogr�r�r�rMr7r8rrDrp�
r8r9rRr9r:r4r�r-r�rps
&&        r0�ln�
Decimal.lnXs`���?� �l�G����w��/����J��$�$������"����4�<��L��:�:��?��'�'�(8�(@�B�
B��d�^���v�v�r�v�v�1��L�L���'�'�)�)�A�-����!��'�E���"�s�3�s�5�z�?�3�A�5�a�7�8�8�9�9���a�K�F��s�5��7�|�S��U��_�v�g�F���'�'�)���(�(��9���h�h�w���#���
r2c�n�UO[UO2*]*
oU]6�c[[U22]*
!UQ6:c#[[PU*
22]*
![	U2oUO
UOqCU]6XcX[U]
U'**
2o[]�U*2o[U2[U2*
VV6*
]*![]
U'*U*
2o[U2U*UQ6*
]*
!)z�Compute a lower bound for the adjusted exponent of self.log10().
In other words, find r such that self.log10() >= 10**r.
Assumes that self is finite and positive and that self != 1.
�231rr�r�s&      r0r�Decimal._log10_exp_bound�s����i�i�#�d�i�i�.�(�1�,���!�8��s�3�x�=��?�"��"�9��s�2�c�6�{�#�A�%�%�
�d�^���v�v�r�v�v�1��!�8��a��Q�B��h�-�C��c�!�e�*�C��s�8�c�#�h�&�#�)�4�q�8�8��"�q�b�&��(�m���3�x�!�|�s�U�{�+�a�/�/r2c
�0�Ue[2oUOUQ5oU%cU!U%f[!UO2]6Xc[!UO
]6XcUO
[Q2!UO]*Q6XcqUOQ*Q[UO2]*
*6Xc8[UO[UO2*]*
2oL�[U2oUOUOqTUOoV`O!2*
]*o[#VEU2oU]]
[[%['U222U*
]*
***%cLU]*
oJ_[)[U]62[%['U22U'2oUO+2oUO-[.2o	UO1U2oV�mU!)z&Returns the base 10 logarithm of self.r~zlog10 of a negative valuer_:r�NNr�)rr�r�r�r�rNr�r	rOr�rr�r�r�r�rqr�_dlog10r�r�rMr7r8rrDrpr�s
&&        r0�log10�
Decimal.log10�s����?� �l�G����w��/����J��$�$������"����:�:��?��'�'�(8�(C�E�
E��9�9�Q�<�3��4�9�9�R�=�C��T�Y�Y��!�9K�4L�#L��$�)�)�c�$�)�)�n�4�q�8�9�C��$��B��6�6�2�6�6�q����A��,�,�.�.�q�0�F����f�-���A�b�3�s�3�u�:��#7��#9�!�#;�<�<�=�=���!���"�3�u�Q�w�<��S��Z��6�'�J�C��'�'�)���(�(��9���h�h�w���#���
r2c�"�UOUQ5oU%cU!Ue[2oUO2%c[!U%fUO	[
Q]2![
UO22oUOU2!)a$Returns the exponent of the magnitude of self's MSD.

The result is the integer which is the exponent of the magnitude
of the most significant digit of self (as though it were truncated
to a single digit while maintaining the value of that digit and
without limiting the resulting exponent).
r~zlogb(0))	r�rr�r�r�r
rr�rDrEs&& r0�logb�Decimal.logb�s}�����w��/����J��?� �l�G����������'�'��	�1�E�E�
�d�m�m�o�&���x�x�� � r2c��UO]6wfUO]6wcP
!UOFDoUQ7fJP
!	P	!)z�Return True if self is a logical operand.

For being logical, it must be a finite number with a sign of 0,
an exponent of 0, and a coefficient whose digits must all be
either 0 or 1.
�01)rNr�rO)r8�digs& r0�
_islogical�Decimal._islogical�s9���:�:��?�d�i�i�1�n���9�9�C��$����r2c�6�UO[U2*
oU]6�cQU*U*oLU]6cV!O'PoUO[U2*
oU]6�cQU*U*oV#1!U]6cV1O'PoV#1!)rKr�)rqr�)r8r9�opa�opb�difs&&&& r0�
_fill_logical�Decimal._fill_logical
s����l�l�S��X�%����7��c�'�C�-�C�
�1�W��|�|�m�n�%�C��l�l�S��X�%����7��c�'�C�-�C��x���1�W��|�|�m�n�%�C��x�r2c
��Ue[2o[UP	Q5oUO2%cUO2%fUO[2!UOV OUO2vq4PO[V42TTt,tFD)vqV[[U2[U2*2MJ+	too2o[]UOQ29%fQ]2!ttooh)zjApplies an 'and' operation between self and other's digits.

Both self and other must be logical numbers.
rr��
rrr�r�r	r�rOr��zipr�r�rMr��r8r�r9r�r�r�br�s&&&     r0�logical_and�Decimal.logical_and
����
�?� �l�G��u�d�3����� � ��(8�(8�(:�(:��'�'�(8�9�9��'�'����E�J�J�G�
������C��E����#�c�!�f�S��V�m�,��E�F����6�=�=��#5�#<�#<��a�@�@��F��1C=
c�|�Ue[2oUO[]QUO*]2U2!)z9Invert all its digits.

The self must be logical number.
r_)r�logical_xorrMrqr>s&&r0�logical_invert�Decimal.logical_invert(
s;��
�?� �l�G���� 0��3�w�|�|�3C�A� F� '�)�	)r2c
��Ue[2o[UP	Q5oUO2%cUO2%fUO[2!UOV OUO2vq4PO[V42TTt,tFD)vqV[[U2[U2*2MJ+	too2o[]UOQ29%fQ]2!ttooh)ziApplies an 'or' operation between self and other's digits.

Both self and other must be logical numbers.
rr�r�r�s&&&     r0�
logical_or�Decimal.logical_or2
r�r�c
��Ue[2o[UP	Q5oUO2%cUO2%fUO[2!UOV OUO2vq4PO[V42TTt,tFD)vqV[[U2[U2*2MJ+	too2o[]UOQ29%fQ]2!ttooh)zjApplies an 'xor' operation between self and other's digits.

Both self and other must be logical numbers.
rr�r�r�s&&&     r0r��Decimal.logical_xorF
r�r�c�D�[UP	Q5oUe[2oUO%fUO%c�UO2oUO2oU%f	U%cPU]6XcU]6XcUO	U2!U]6XcU]6XcUO	U2!UOV2!UO
2OUO
22oU]6XcUOU2oUP6XcSoLSoUO	U2!�z8Compares the values numerically with their sign ignored.r�	rrr�r�rDr�rBr�r@rAs&&&    r0�max_mag�Decimal.max_magZ
s����u�d�3���?� �l�G�����u�0�0�0�����B�����B��R���7�r�Q�w��9�9�W�-�-���7�r�Q�w� �:�:�g�.�.��'�'��7�7��M�M�O� � ����!1�2����6��"�"�5�)�A���7��C��C��x�x�� � r2c�D�[UP	Q5oUe[2oUO%fUO%c�UO2oUO2oU%f	U%cPU]6XcU]6XcUO	U2!U]6XcU]6XcUO	U2!UOV2!UO
2OUO
22oU]6XcUOU2oUP6XcSoLSoUO	U2!r�r�rAs&&&    r0�min_mag�Decimal.min_magx
s����u�d�3���?� �l�G�����u�0�0�0�����B�����B��R���7�r�Q�w��9�9�W�-�-���7�r�Q�w� �:�:�g�.�.��'�'��7�7��M�M�O� � ����!1�2����6��"�"�5�)�A���7��C��C��x�x�� � r2c��Ue[2oUOUQ5oU%cU!UO2P6Xc[!UO2]6Xc-[	]QUO
*UO
22!UO2oUO[2UO2UOU2oV06wcU!UO[	]QUO2]*
2U2!)z=Returns the largest representable number smaller than itself.r~ror_)rr�r�r�rMrqr�r�r8r�_ignore_all_flagsrDrYre�r8r9rR�new_selfs&&  r0�
next_minus�Decimal.next_minus�
s����?� �l�G����w��/����J������#�$�$������"�#�A�s�7�<�<�'7�����H�H��,�,�.�����k�*��!�!�#��9�9�W�%�����O��|�|�,�Q��W�]�]�_�Q�5F�G�#�%�	%r2c��Ue[2oUOUQ5oU%cU!UO2]6Xc[!UO2P6Xc-[	]QUO
*UO
22!UO2oUO[2UO2UOU2oV06wcU!UO[	]QUO2]*
2U2!)z=Returns the smallest representable number larger than itself.r~ror_)rr�r�r�rMrqr�r�r8rr�rDrVrer�s&&  r0�	next_plus�Decimal.next_plus�
s����?� �l�G����w��/����J������"��������#�#�A�s�7�<�<�'7�����H�H��,�,�.�����m�,��!�!�#��9�9�W�%�����O��|�|�,�Q��W�]�]�_�Q�5F�G�#�%�	%r2c��[UP	Q5oUe[2oUOV2oU%cU!UOU2oU]6XcUO	U2!UP6XcUOU2oLUO
U2oUO2%cNUO[QUO2UO[2UO[2U!UO2UO6crUO[2UO[ 2UO[2UO[2U%fUO["2U!)a[Returns the number closest to self, in the direction towards other.

The result is the closest representable number to self
(excluding self) that is in the direction towards other,
unless both have the same value.  If the two operands are
numerically equal, then the result is a copy of self with the
sign set to be the same as the sign of other.
rz Infinite result from next_toward)rrr�r�rer�r�r�r�rrNrrr�r�rr
r)r8r�r9rR�
comparisons&&&  r0�next_toward�Decimal.next_toward�
s.���u�d�3���?� �l�G����u�.����J��Y�Y�u�%�
���?��>�>�%�(�(�����.�.��)�C��/�/�'�*�C��?�?���� � ��!C�!$���
,�
� � ��)�� � ��)��
��\�\�^�g�l�l�
*�� � ��+�� � ��+�� � ��)�� � ��)���$�$�W�-��
r2c��UO2%cQ!UO2%cQ!UO2oU]6XcQ!UP6XcQ!UO2%cUO%cQ!Q!Ue[2oUO
UQ5%cUO%cQ!Q	!UO%cQ
!Q!)z�Returns an indication of the class of self.

The class is one of the following strings:
  sNaN
  NaN
  -Infinity
  -Normal
  -Subnormal
  -Zero
  +Zero
  +Subnormal
  +Normal
  +Infinity
r�r2z	+Infinityz	-Infinityz-Zeroz+Zeror~z
-Subnormalz
+Subnormalz-Normalz+Normal)r�r�r�r�rNrr�)r8r9�infs&& r0�number_class�Decimal.number_class�
s����<�<�>�>���<�<�>�>����� ���!�8���"�9���<�<�>�>��z�z�z����?� �l�G����W��-�-��z�z�z�#�#��:�:�:��r2c��[]
2!)z'Just returns 10, as this is Decimal, :)r�r�s&r0�radix�
Decimal.radixs���r�{�r2c���Ue[2o[UP	Q5oUOV2oU%cU!UO]6wcUO	[
2!UO'[U2t96:cUO6:fLUO	[
2!UO2%c[U2![U2oUOoUO[U2*
oU]6�cQU*U*oLU]6cVV'PoVTPUPU*o[UOUOQ29%fQUO2!)z5Returns a rotated copy of self, value-of-other times.rr��rrr�r�r�r	rqr�r�rrOr�rMrNr�)r8r�r9rR�torot�rotdig�topad�rotateds&&&     r0�rotate�Decimal.rotate s'���?� �l�G��u�d�3�����u�.����J��:�:��?��'�'�(8�9�9����
��U��;�w�|�|�;��'�'�(8�9�9�������4�=� ��E�
���������s�6�{�*���1�9���Y��'�F�
�Q�Y��F�G�_�F���.�6�&�5�>�1����
�
� '���s� 3� :� :�s�D�I�I�G�	Gr2c��Ue[2o[UP	Q5oUOV2oU%cU!UO]6wcUO	[
2!QUOUO**o]UOUO**oU[U2t96:cU6:fLUO	[
2!UO2%c[U2![UOUOUO[U2*2oUOU2oU!)z>Returns self operand after adding the second value to its exp.rr)rrr�r�r�r	rrrqr�r�rrMrNrOrD)r8r�r9rR�liminf�limsupr�s&&&    r0�scaleb�Decimal.scalebAs����?� �l�G��u�d�3�����u�.����J��:�:��?��'�'�(8�9�9��w�|�|�g�l�l�2�3���w�|�|�g�l�l�2�3���#�e�*�.��.��'�'�(8�9�9�������4�=� ��T�Z�Z����D�I�I��E�
�4J�K��
�F�F�7�O���r2c��Ue[2o[UP	Q5oUOV2oU%cU!UO]6wcUO	[
2!UO'[U2t96:cUO6:fLUO	[
2!UO2%c[U2![U2oUOoUO[U2*
oU]6�cQU*U*oLU]6cVV'PoU]6cUPUoLUQU**oVrO'Po[UOUOQ29%fQUO2!)z5Returns a shifted copy of self, value-of-other times.rr�r�)r8r�r9rRr�r�r��shifteds&&&     r0rg�
Decimal.shiftZsC���?� �l�G��u�d�3�����u�.����J��:�:��?��'�'�(8�9�9����
��U��;�w�|�|�;��'�'�(8�9�9�������4�=� ��E�
���������s�6�{�*���1�9���Y��'�F�
�Q�Y��F�G�_�F��1�9��V�e�n�G��s�5�y�(�G��|�|�m�n�-�G���
�
�$+�N�N�3�$7�$>�$>�3��	�	�K�	Kr2c�4�UO[U211!r-)�	__class__r�r�s&r0�
__reduce__�Decimal.__reduce__�s������T���-�-r2c�b�[U2[IcU!UO[U22!r-��typerr�r�r�s&r0�__copy__�Decimal.__copy__��&����:�� ��K��~�~�c�$�i�(�(r2c�b�[U2[IcU!UO[U22!r-r�)r8�memos&&r0�__deepcopy__�Decimal.__deepcopy__�r�r2c�X�Ue[2o[VQ5oUO%cS[UOU2o[UO
22oUQ*Q6Xc
UQ*
o[VVU2!UQ*eQQ,UO*UQ$UQ*Q6Xc3[UOUOUO]*2oUOoUQ*oUd�UQ*Q7cUOU]*U2oL[UQ*Q7cUOU'U2oL9UQ*Q	7c,[UO2U6�cUOV�2oU%f2UO]6�c!UQ*Q7cUO]U2oU%f%UQ
*%cUO%c]o	LUOo	UO[UO2*o
UQ*Q7cU%fUd]U*
oL?]oL<UQ*Q7cS
oL+UQ*Q	7cUO]6:cU
Q6�cS
oL]oW]6cQoQU'*UO*o
LyU[UO26�c8UOQU[UO2*
**oPo
L(UOPU9%fQoUOUPo
V�*
o[!V�V�U2!)
aLFormat a Decimal instance according to the given specifier.

The specifier should be a standard format specifier, with the
form described in PEP 3101.  Formatting types 'e', 'E', 'f',
'F', 'g', 'G', 'n' and '%' are supported.  If the formatting
type is omitted it defaults to 'g' or 'G', depending on the
value of context.capitals.
)�_localeconvr��%�g�G�	precision�eEzfF%�gG�no_neg_0r�r6)r�_parse_format_specifierr��_format_signrNr�rB�
_format_alignr7rMrOr�rpr.rQr��_format_number)r8�	specifierr9r��specr]�bodyrpr��
adjusted_signr9r:r�r�r�s&&&&           r0�
__format__�Decimal.__format__�s����?� �l�G�&�y�J��������
�
�D�1�D��t�}�}��'�D��F�|�s�"����� ��T�2�2���<����:�g�&6�&6�7�D��L���<�3��#�D�J�J��	�	�4�9�9�Q�;�G�D��#�#����%�	�� ��F�|�t�#��{�{�9�Q�;��9���f���&��}�}�i�Z��:���f���%�#�d�i�i�.�9�*D��{�{�9�7����	�	�A�
�$�v�,�%�*?��=�=��H�-�D���Z�(�(�T�Z�Z�Z��M� �J�J�M��Y�Y��T�Y�Y��/�
���<�4���I�1��y�=����
�&�\�U�
"�!�H�
�&�\�T�
!��y�y�A�~�*�r�/�%�����a�<��G��X�I�����2�H�
��D�I�I��
&��i�i�#�x��D�I�I��'>�"?�?�G��H��i�i�	��*�1�1�c�G��y�y���+�H��!���m�h�T�J�Jr2)r�rOr�rN)r�rOrNr�)r�N)NNr-)FN)TN)�r=r>r?r@rA�	__slots__r��classmethodr�r�r�r�r�r�r�r�r�rr	r
rrrr$r�r.r;r?rFrIrMrV�__radd__rYr\rb�__rmul__rjrprsrzr}r�r�r�r�r�r�r��	__trunc__�propertyr�r�r�r�rPrDr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
rrr!r�r'rQr.r2r��to_integralr<rPr(r�r�r�rOrRr@r^rBrCrer�rlror&rrxr�r}r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rgr�r�r�rrBrCrDs@r0rr�s����6�6�I�T@�l�A��A��*��*�X
���@�B4�-'�@%�$�%�$�%�)�$(�4O�0�d+�
2/�h7�!�,!�*�,T�l�H�B�4�6�n�H�9!�v�B8�"#�H7��64�I!�V/�89��7��I�
���������$�
�Z�L�'��-�-�+�+�+�#� ��&�*�*�&�"� �	��<6�|
2�
4�*/�XS4�jv?�pV�p<�@�2;�z
'� 8�D�.�:.�"$�K�a�F(!�T !�D%�2���
4�F�R
"�K�O�=�I�V�$� �'�/� �� �.�9�,�20�d0�<1�f!�<��A�()�A�(A�(!�<!�<%�.%�.,�\(�T�G�B�2$K�N.�)�
)�TK�TKr2c�j�[O[2oVmVmV$mV4mU!)z�Create a decimal instance directly, without any validation,
normalization (e.g. removal of leading zeros) or argument
conversion.

This function is for *internal use only*.
)r�r�rrNrOr�r�)r]�coefficientr��specialr8s&&&& r0rMrM�s,���>�>�'�"�D��J��I��I����Kr2c�8`�\sQsQsnQsQsQsQsQsUs	P!)r�i�z�Context manager class to support localcontext().

Sets a copy of the supplied context in __enter__() and restores
the previous decimal context in __exit__()
c�2�UO2UmP!r-)r�r�)r8r�s&&r0�__init__�_ContextManager.__init__s��&�+�+�-��r2c�d�[2Um[UO2UO!r-)r�
saved_contextrr�r�s&r0�	__enter__�_ContextManager.__enter__s&��'�\����4�#�#�$����r2c�2�[UO2P!r-)rr)r8�t�v�tbs&&&&r0�__exit__�_ContextManager.__exit__
s���4�%�%�&r2)r�r)
r=r>r?r@rArrrrBrCrDs@r0r�r��s�����
.� �'�'r2r�c�(`�\sQsQsnQsQUQksQsQsQsQs	Qs
Q	sQ
sQs
QsQ
s\sQVQksQsQsQsPsQsQsQsQWQksQsQsQsQsQsQsQs Qs!Qs"Qs#Q s$Q!s%Q"s&Q#s'Q$s(Q%s)Q&s*Q's+Q(s,Q)s-Q*s.Q+s/Q,s0Q-s1Q.s2Q/s3Q0s4Q1s5Q2s6Q3s7Q4s8Q5s9Q6s:Q7s;Q8s<Q9s=Q:s>Q;s?Q<s@Q=sAQ>sBQ?sCQ@sDQAsEQBsFQCsGQDsHQVQEksIQFsJQGsKQHsLQIsMQJsNQKsOQLsPQMsQQNsRQOsSQPsTQQsUQRsVQSsW\WsXQTsYUsZP!)Xri
a�Contains the context for a Decimal instance.

Contains:
prec - precision (for use in rounding, division, square roots..)
rounding - rounding type (how you round)
traps - If traps[exception] = 1, then the exception is
                raised when it is caused.  Otherwise, a value is
                substituted in.
flags  - When an exception is caused, flags[exception] is set.
         (Whether or not the trap_enabler is set)
         Should be reset by user of Decimal instance.
Emin -   Minimum exponent
Emax -   Maximum exponent
capitals -      If 1, 1*10^1 is printed as 1E+1.
                If 0, printed as 1e1
clamp -  If 1, change exponents if too high (Default 0)
c
�``�[o
UdSLW
OUmUdSLW
OUmUdSLW
OUmUdSLW
O
UmUdSLW
OUmUdSLW
OUmU	e	,UmLV�mRe!W
OO2Um	LB[R[2%f&[U1Qk[R*22Um	LRUm	Re"[O[]2UmP![R[2%f'[U1Qk[R*22UmP!RUmP![cCKzh9h)Nc3�N:�SF �Dp[UR721w�	J	P!3hr-�r�)�.0r�r�s& �r0�	<genexpr>�#Context.__init__.<locals>.<genexpr>9���<L���<L�q�#�a�5�j�/�2�<L���%c3�N:�SF �Dp[UR721w�	J	P!3hr-r$)r%r�rs& �r0r&r'@r(r))r�	NameErrorrqrpr�rrr7r��_ignored_flagsr�r�r�r�r�r�r)r8rqrpr�rrr7r�rr�r,�dcs&&&&&&&ff& r0r�Context.__init__ s&���
	��B�!�,�D�"�'�'��	�$,�$8��b�k�k��
� �,�D�"�'�'��	� �,�D�"�'�'��	�$,�$8��b�k�k��
�#�/�U�R�X�X��
��!�"$�D��"0���=�������D�J��E�4�(�(��M�H�u�<L�M�M�D�J��D�J��=����x��3�D�J��E�4�(�(��M�H�u�<L�M�M�D�J��D�J��7�	��	�s�E7�7	F�F�Fc�H�[U[2%f[QU*2gUQ6XcV$6�c[QVVB1*2gLBUQ6XcV#6c[QVVB1*2gL V#6fV$6�c[QVVB1*2g[OVU2!)z%s must be an integer�-infz%s must be in [%s, %d]. got: %sr�z%s must be in [%d, %s]. got: %sz%s must be in [%d, %d]. got %s)r�r�r�r�r��__setattr__)r8�namer��vmin�vmaxs&&&&&r0�_set_integer_check�Context._set_integer_checkDs����%��%�%��3�d�:�;�;��6�>��|� �!B�d�RV�E^�!^�_�_��
�U�]��|� �!B�d�RV�E^�!^�_�_���|�u�|� �!A�T�QU�D]�!]�^�^��!�!�$�e�4�4r2c��[U[2%f[QU*2gSFD oU[7cJ[	QU*2g	[FDoV27cJ[	QU*2g	[
O
VU2!)z%s must be a signal dictz%s is not a valid signal dict)r�r�r�r��KeyErrorr�r1)r8r2r�r�s&&& r0�_set_signal_dict�Context._set_signal_dictRs{���!�T�"�"��6��:�;�;��C��(�?��>��B�C�C���8�C��8��>��B�C�C���!�!�$�a�0�0r2c��UQ6XcUOV]Q2!UQ6XcUOVQ]2!UQ6XcUOV]Q2!UQ6XcUOV]]2!UQ6XcUOV]]2!UQ6Xc4U[7f[QU*2g[O	VU2!UQ	6XfUQ
6XcUOV2!UQ6Xc[O	VU2![
QU*2g)
rqr�r�r0rrr7r�rpz%s: invalid rounding moderr�r,z.'decimal.Context' object has no attribute '%s')r5�_rounding_modesr�r�r1r9�AttributeError)r8r2r�s&&&r0r1�Context.__setattr__]s���6�>��*�*�4��5�A�A�
�V�^��*�*�4���B�B�
�V�^��*�*�4��5�A�A�
�Z�
��*�*�4��1�=�=�
�W�_��*�*�4��1�=�=�
�Z�
��O�+� � ;�e� C�D�D��%�%�d�%�8�8�
�W�_�����(�(��5�5�
�%�
%��%�%�d�%�8�8� �@�4�G�I�
Ir2c�(�[QU*2g)z%s cannot be deleted)r=)r8r2s&&r0�__delattr__�Context.__delattr__vs���3�d�:�;�;r2c	��UOO2TTt,tFDvqU%fJUMJ	oooUOO2TTt,tFDvqU%fJUMJ	oooUOUOUO
UOUOUOUOV411!ttoohttoohr-)
rr�r�r�rqrpr�rrr7r�)r8�sigrrr�s&    r0r��Context.__reduce__zs���#'�:�:�#3�#3�#5�;�#5������#5��;�#'�:�:�#3�#3�#5�;�#5������#5��;�������D�M�M�4�9�9�d�i�i�����
�
�E�:�;�	;��<��;s�C�C�C	�)C	c�R�,oUOQ[U2*2UOO2TTt,tFDvq#U%fJUOMJ	oooUOQQOU2*Q*2UOO2TTt,tFDvqSU%fJUOMJ	oooUOQQOU2*Q*2QOU2Q*!ttoohttooh)zShow the current context.zrContext(prec=%(prec)d, rounding=%(rounding)s, Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d, clamp=%(clamp)dzflags=[�, �]ztraps=[�))r��varsrr�r=r�r�)r8r�r�r�namesrs&     r0r.�Context.__repr__�s�����	���#���:��	�)-�
�
�(8�(8�(:�@�(:���a�����(:��@�	����T�Y�Y�u�-�-��3�4�(,�
�
�(8�(8�(:�@�(:���a�����(:��@�	����T�Y�Y�u�-�-��3�4��y�y��|�c�!�!��	A��@s�D�D�1D#�D#c�N�UOFDo]UOU$J	P!)zReset all flags to zero)r�r8�flags& r0r��Context.clear_flags�����J�J�D� �D�J�J�t��r2c�N�UOFDo]UOU$J	P!)zReset all traps to zero)r�rMs& r0�clear_traps�Context.clear_traps�rPr2c���[UOUOUOUOUO
UOUOUOUO2	oU!)z!Returns a shallow copy from self.)
rrqrpr�rrr7r�rr�r,�r8�ncs& r0r7�Context._shallow_copy�sM��
�T�Y�Y��
�
�t�y�y�$�)�)��]�]�D�J�J��
�
�D�J�J��(�(�*���	r2c��[UOUOUOUOUO
UOUOO2UOO2UO2	oU!)zReturns a deep copy from self.)rrqrpr�rrr7r�rr�r�r,rUs& r0r��Context.copy�s\��
�T�Y�Y��
�
�t�y�y�$�)�)��]�]�D�J�J��Z�Z�_�_�&��
�
���(9��(�(�*���	r2c��[OV2oV@O7cU2OU,UN3!]UOU$UO
U*%fU2OU,UN3!UU2g)z�Handles an error

If the flag is in _ignored_flags, returns the default response.
Otherwise, it sets the flag, then, if the corresponding
trap_enabler is set, it reraises the exception.  Otherwise, it returns
the default value after setting the flag.
)�_condition_mapr{r,r:rr�)r8�	condition�explanationr/�errors&&&* r0r��Context._raise_error�sx���"�"�9�8���'�'�'��7�>�>�$�.��.�.���
�
�5���z�z�%� � ��;�%�%�d�2�T�2�2��K� � r2c�,�UO[!)z$Ignore all flags, if they are raised)�
_ignore_flagsr�r�s&r0r��Context._ignore_all_flags�s���!�!�8�,�,r2c�\�UO[U2*Um[U2!)z$Ignore the flags, if they are raised)r,r�)r8rs&*r0ra�Context._ignore_flags�s%�� $�2�2�T�%�[�@����E�{�r2c��U%c-[U]*[[12%c
U]*oSFDoUOO	U2J 	P!)z+Stop ignoring the flags, if they are raised)r�r�r�r,�remove)r8rrNs&* r0�
_regard_flags�Context._regard_flags�s@���Z��a��5��,�7�7��!�H�E��D����&�&�t�,�r2c�^�[UOUO*
]*2!)z!Returns Etiny (= Emin - prec + 1))r�r�rqr�s&r0re�
Context.Etiny�����4�9�9�t�y�y�(�1�,�-�-r2c�^�[UOUO*
]*2!)z,Returns maximum exponent (= Emax - prec + 1))r�rrrqr�s&r0r��Context.Etop�rkr2c�,�UOoVmU!)a�Sets the rounding type.

Sets the rounding type, and returns the current (previous)
rounding type.  Often used like:

context = context.copy()
# so you don't change the calling context
# if an error occurs in the middle.
rounding = context._set_rounding(ROUND_UP)
val = self.__sub__(other, context=context)
context._set_rounding(rounding)

This will make it round up for that operation.
)rp)r8r�rps&& r0r8�Context._set_rounding�s���=�=���
��r2c��[U[2%c2VO26wfQU7cUO[Q2![VQ5oUO
2%cL[UO2UOUO*
6�cUO[Q2!UOU2!)z�Creates a new Decimal instance but using self as context.

This method implements the to-number operation of the
IBM Decimal specification.r�zAtrailing or leading whitespace and underscores are not permitted.r~zdiagnostic info too long in NaN)r�r�r�r�rrr�r�rOrqr�rD)r8r�r�s&& r0�create_decimal�Context.create_decimal�s����c�3���S�I�I�K�%7�3�#�:��$�$�%5�&F�G�
G�
�C�&���8�8�:�:�#�a�f�f�+��	�	�D�J�J�(>�>��$�$�%5�%F�H�
H��v�v�d�|�r2c�P�[OU2oUOU2!)aCreates a new Decimal instance from a float but rounding using self
as the context.

>>> context = Context(prec=5, rounding=ROUND_DOWN)
>>> context.create_decimal_from_float(3.1415926535897932)
Decimal('3.1415')
>>> context = Context(prec=5, traps=[Inexact])
>>> context.create_decimal_from_float(3.1415926535897932)
Traceback (most recent call last):
    ...
decimal.Inexact: None

)rr�rD)r8r�r�s&& r0�create_decimal_from_float�!Context.create_decimal_from_float�s"��
���q�!���v�v�d�|�r2c�B�[UP	Q5oUOUQ5!)a�Returns the absolute value of the operand.

If the operand is negative, the result is the same as using the
minus operation on the operand.  Otherwise, the result is the same
as using the plus operation on the operand.

>>> ExtendedContext.abs(Decimal('2.1'))
Decimal('2.1')
>>> ExtendedContext.abs(Decimal('-100'))
Decimal('100')
>>> ExtendedContext.abs(Decimal('101.5'))
Decimal('101.5')
>>> ExtendedContext.abs(Decimal('-101.5'))
Decimal('101.5')
>>> ExtendedContext.abs(-1)
Decimal('1')
rr~)rrM�r8rs&&r0r��Context.abss!��$
�1�d�+���y�y��y�&�&r2c�~�[UP	Q5oUOV Q5oU[Ic[QU*2gU!)aSReturn the sum of the two operands.

>>> ExtendedContext.add(Decimal('12'), Decimal('7.00'))
Decimal('19.00')
>>> ExtendedContext.add(Decimal('1E+2'), Decimal('1.01E+4'))
Decimal('1.02E+4')
>>> ExtendedContext.add(1, Decimal(2))
Decimal('3')
>>> ExtendedContext.add(Decimal(8), 5)
Decimal('13')
>>> ExtendedContext.add(5, 5)
Decimal('10')
rr~�Unable to convert %s to Decimal)rrVr�r��r8rr�ros&&& r0�add�Context.add&s>��
�1�d�+��
�I�I�a�I�&������=��A�B�B��Hr2c�8�[UOU22!r-)r�rDrws&&r0�_apply�Context._apply;s���1�6�6�$�<� � r2c�f�[U[2%f[Q2gUO2!)z�Returns the same Decimal object.

As we do not have different encodings for the same number, the
received object already is in its canonical form.

>>> ExtendedContext.canonical(Decimal('2.50'))
Decimal('2.50')
z,canonical requires a Decimal as an argument.)r�rr�rOrws&&r0rO�Context.canonical>s)���!�W�%�%��J�K�K��{�{�}�r2c�B�[UP	Q5oUOV Q5!)a�Compares values numerically.

If the signs of the operands differ, a value representing each
operand ('-1' if the operand is less than zero, '0' if the operand
is zero or negative zero, or '1' if the operand is greater than
zero) is used in place of that operand for the comparison instead of
the actual operand.

The comparison is then effected by subtracting the second operand
from the first and then returning a value according to the result of
the subtraction: '-1' if the result is less than zero, '0' if the
result is zero or negative zero, or '1' if the result is greater
than zero.

>>> ExtendedContext.compare(Decimal('2.1'), Decimal('3'))
Decimal('-1')
>>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.1'))
Decimal('0')
>>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.10'))
Decimal('0')
>>> ExtendedContext.compare(Decimal('3'), Decimal('2.1'))
Decimal('1')
>>> ExtendedContext.compare(Decimal('2.1'), Decimal('-3'))
Decimal('1')
>>> ExtendedContext.compare(Decimal('-3'), Decimal('2.1'))
Decimal('-1')
>>> ExtendedContext.compare(1, 2)
Decimal('-1')
>>> ExtendedContext.compare(Decimal(1), 2)
Decimal('-1')
>>> ExtendedContext.compare(1, Decimal(2))
Decimal('-1')
rr~)rr�r8rr�s&&&r0r�Context.compareKs"��D
�1�d�+���y�y��y�)�)r2c�B�[UP	Q5oUOV Q5!)a8Compares the values of the two operands numerically.

It's pretty much like compare(), but all NaNs signal, with signaling
NaNs taking precedence over quiet NaNs.

>>> c = ExtendedContext
>>> c.compare_signal(Decimal('2.1'), Decimal('3'))
Decimal('-1')
>>> c.compare_signal(Decimal('2.1'), Decimal('2.1'))
Decimal('0')
>>> c.flags[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> c.compare_signal(Decimal('NaN'), Decimal('2.1'))
Decimal('NaN')
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> c.compare_signal(Decimal('sNaN'), Decimal('2.1'))
Decimal('NaN')
>>> print(c.flags[InvalidOperation])
1
>>> c.compare_signal(-1, 2)
Decimal('-1')
>>> c.compare_signal(Decimal(-1), 2)
Decimal('-1')
>>> c.compare_signal(-1, Decimal(2))
Decimal('-1')
rr~)rrRr�s&&&r0rR�Context.compare_signalps%��@
�1�d�+�������0�0r2c�@�[UP	Q5oUOU2!)a|Compares two operands using their abstract representation.

This is not like the standard compare, which use their numerical
value.  Note that a total ordering is defined for all possible
abstract representations.

>>> ExtendedContext.compare_total(Decimal('12.73'), Decimal('127.9'))
Decimal('-1')
>>> ExtendedContext.compare_total(Decimal('-127'),  Decimal('12'))
Decimal('-1')
>>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.3'))
Decimal('-1')
>>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.30'))
Decimal('0')
>>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('12.300'))
Decimal('1')
>>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('NaN'))
Decimal('-1')
>>> ExtendedContext.compare_total(1, 2)
Decimal('-1')
>>> ExtendedContext.compare_total(Decimal(1), 2)
Decimal('-1')
>>> ExtendedContext.compare_total(1, Decimal(2))
Decimal('-1')
r)rr@r�s&&&r0r@�Context.compare_total�s��4
�1�d�+�����q�!�!r2c�@�[UP	Q5oUOU2!)z�Compares two operands using their abstract representation ignoring sign.

Like compare_total, but with operand's sign ignored and assumed to
be 0.
r)rr^r�s&&&r0r^�Context.compare_total_mag�s!��
�1�d�+���"�"�1�%�%r2c�>�[UP	Q5oUO2!)z�Returns a copy of the operand with the sign set to 0.

>>> ExtendedContext.copy_abs(Decimal('2.1'))
Decimal('2.1')
>>> ExtendedContext.copy_abs(Decimal('-100'))
Decimal('100')
>>> ExtendedContext.copy_abs(-1)
Decimal('1')
r)rrBrws&&r0rB�Context.copy_abs�s��
�1�d�+���z�z�|�r2c�4�[UP	Q5o[U2!)z�Returns a copy of the decimal object.

>>> ExtendedContext.copy_decimal(Decimal('2.1'))
Decimal('2.1')
>>> ExtendedContext.copy_decimal(Decimal('-1.00'))
Decimal('-1.00')
>>> ExtendedContext.copy_decimal(1)
Decimal('1')
r)rrrws&&r0�copy_decimal�Context.copy_decimal�s��
�1�d�+���q�z�r2c�>�[UP	Q5oUO2!)z�Returns a copy of the operand with the sign inverted.

>>> ExtendedContext.copy_negate(Decimal('101.5'))
Decimal('-101.5')
>>> ExtendedContext.copy_negate(Decimal('-101.5'))
Decimal('101.5')
>>> ExtendedContext.copy_negate(1)
Decimal('-1')
r)rrCrws&&r0rC�Context.copy_negate�s��
�1�d�+���}�}��r2c�@�[UP	Q5oUOU2!)a�Copies the second operand's sign to the first one.

In detail, it returns a copy of the first operand with the sign
equal to the sign of the second operand.

>>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('7.33'))
Decimal('1.50')
>>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('7.33'))
Decimal('1.50')
>>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('-7.33'))
Decimal('-1.50')
>>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('-7.33'))
Decimal('-1.50')
>>> ExtendedContext.copy_sign(1, -2)
Decimal('-1')
>>> ExtendedContext.copy_sign(Decimal(1), -2)
Decimal('-1')
>>> ExtendedContext.copy_sign(1, Decimal(-2))
Decimal('-1')
r)rrer�s&&&r0re�Context.copy_sign�s��*
�1�d�+���{�{�1�~�r2c�~�[UP	Q5oUOV Q5oU[Ic[QU*2gU!)a�Decimal division in a specified context.

>>> ExtendedContext.divide(Decimal('1'), Decimal('3'))
Decimal('0.333333333')
>>> ExtendedContext.divide(Decimal('2'), Decimal('3'))
Decimal('0.666666667')
>>> ExtendedContext.divide(Decimal('5'), Decimal('2'))
Decimal('2.5')
>>> ExtendedContext.divide(Decimal('1'), Decimal('10'))
Decimal('0.1')
>>> ExtendedContext.divide(Decimal('12'), Decimal('12'))
Decimal('1')
>>> ExtendedContext.divide(Decimal('8.00'), Decimal('2'))
Decimal('4.00')
>>> ExtendedContext.divide(Decimal('2.400'), Decimal('2.0'))
Decimal('1.20')
>>> ExtendedContext.divide(Decimal('1000'), Decimal('100'))
Decimal('10')
>>> ExtendedContext.divide(Decimal('1000'), Decimal('1'))
Decimal('1000')
>>> ExtendedContext.divide(Decimal('2.40E+6'), Decimal('2'))
Decimal('1.20E+6')
>>> ExtendedContext.divide(5, 5)
Decimal('1')
>>> ExtendedContext.divide(Decimal(5), 5)
Decimal('1')
>>> ExtendedContext.divide(5, Decimal(5))
Decimal('1')
rr~rz)rrjr�r�r{s&&& r0�divide�Context.divide�s>��<
�1�d�+��
�M�M�!�M�*������=��A�B�B��Hr2c�~�[UP	Q5oUOV Q5oU[Ic[QU*2gU!)a�Divides two numbers and returns the integer part of the result.

>>> ExtendedContext.divide_int(Decimal('2'), Decimal('3'))
Decimal('0')
>>> ExtendedContext.divide_int(Decimal('10'), Decimal('3'))
Decimal('3')
>>> ExtendedContext.divide_int(Decimal('1'), Decimal('0.3'))
Decimal('3')
>>> ExtendedContext.divide_int(10, 3)
Decimal('3')
>>> ExtendedContext.divide_int(Decimal(10), 3)
Decimal('3')
>>> ExtendedContext.divide_int(10, Decimal(3))
Decimal('3')
rr~rz)rr�r�r�r{s&&& r0�
divide_int�Context.divide_ints>�� 
�1�d�+��
�N�N�1�N�+������=��A�B�B��Hr2c�~�[UP	Q5oUOV Q5oU[Ic[QU*2gU!)a�Return (a // b, a % b).

>>> ExtendedContext.divmod(Decimal(8), Decimal(3))
(Decimal('2'), Decimal('2'))
>>> ExtendedContext.divmod(Decimal(8), Decimal(4))
(Decimal('2'), Decimal('0'))
>>> ExtendedContext.divmod(8, 4)
(Decimal('2'), Decimal('0'))
>>> ExtendedContext.divmod(Decimal(8), 4)
(Decimal('2'), Decimal('0'))
>>> ExtendedContext.divmod(8, Decimal(4))
(Decimal('2'), Decimal('0'))
rr~rz)rrzr�r�r{s&&& r0rf�Context.divmod4s>��
�1�d�+��
�L�L��L�)������=��A�B�B��Hr2c�B�[UP	Q5oUOUQ5!)a�Returns e ** a.

>>> c = ExtendedContext.copy()
>>> c.Emin = -999
>>> c.Emax = 999
>>> c.exp(Decimal('-Infinity'))
Decimal('0')
>>> c.exp(Decimal('-1'))
Decimal('0.367879441')
>>> c.exp(Decimal('0'))
Decimal('1')
>>> c.exp(Decimal('1'))
Decimal('2.71828183')
>>> c.exp(Decimal('0.693147181'))
Decimal('2.00000000')
>>> c.exp(Decimal('+Infinity'))
Decimal('Infinity')
>>> c.exp(10)
Decimal('22026.4658')
rr~)rr�rws&&r0r��Context.expIs!��*�!�T�*���u�u�T�u�"�"r2c�D�[UP	Q5oUOV#UQ5!)a�Returns a multiplied by b, plus c.

The first two operands are multiplied together, using multiply,
the third operand is then added to the result of that
multiplication, using add, all with only one final rounding.

>>> ExtendedContext.fma(Decimal('3'), Decimal('5'), Decimal('7'))
Decimal('22')
>>> ExtendedContext.fma(Decimal('3'), Decimal('-5'), Decimal('7'))
Decimal('-8')
>>> ExtendedContext.fma(Decimal('888565290'), Decimal('1557.96930'), Decimal('-86087.7578'))
Decimal('1.38435736E+12')
>>> ExtendedContext.fma(1, 3, 4)
Decimal('7')
>>> ExtendedContext.fma(1, Decimal(3), 4)
Decimal('7')
>>> ExtendedContext.fma(1, 3, Decimal(4))
Decimal('7')
rr~)rr�)r8rr�r:s&&&&r0r��Context.fmaas#��(
�1�d�+���u�u�Q�4�u�(�(r2c�f�[U[2%f[Q2gUO2!)z�Return True if the operand is canonical; otherwise return False.

Currently, the encoding of a Decimal instance is always
canonical, so this method returns True for any Decimal.

>>> ExtendedContext.is_canonical(Decimal('2.50'))
True
z/is_canonical requires a Decimal as an argument.)r�rr�rlrws&&r0rl�Context.is_canonicalxs*���!�W�%�%��M�N�N��~�~��r2c�>�[UP	Q5oUO2!)a�Return True if the operand is finite; otherwise return False.

A Decimal instance is considered finite if it is neither
infinite nor a NaN.

>>> ExtendedContext.is_finite(Decimal('2.50'))
True
>>> ExtendedContext.is_finite(Decimal('-0.3'))
True
>>> ExtendedContext.is_finite(Decimal('0'))
True
>>> ExtendedContext.is_finite(Decimal('Inf'))
False
>>> ExtendedContext.is_finite(Decimal('NaN'))
False
>>> ExtendedContext.is_finite(1)
True
r)rrorws&&r0ro�Context.is_finite�s��&
�1�d�+���{�{�}�r2c�>�[UP	Q5oUO2!)a
Return True if the operand is infinite; otherwise return False.

>>> ExtendedContext.is_infinite(Decimal('2.50'))
False
>>> ExtendedContext.is_infinite(Decimal('-Inf'))
True
>>> ExtendedContext.is_infinite(Decimal('NaN'))
False
>>> ExtendedContext.is_infinite(1)
False
r)rr&rws&&r0r&�Context.is_infinite�s��
�1�d�+���}�}��r2c�>�[UP	Q5oUO2!)z�Return True if the operand is a qNaN or sNaN;
otherwise return False.

>>> ExtendedContext.is_nan(Decimal('2.50'))
False
>>> ExtendedContext.is_nan(Decimal('NaN'))
True
>>> ExtendedContext.is_nan(Decimal('-sNaN'))
True
>>> ExtendedContext.is_nan(1)
False
r)rrrws&&r0r�Context.is_nan�s��
�1�d�+���x�x�z�r2c�B�[UP	Q5oUOUQ5!)agReturn True if the operand is a normal number;
otherwise return False.

>>> c = ExtendedContext.copy()
>>> c.Emin = -999
>>> c.Emax = 999
>>> c.is_normal(Decimal('2.50'))
True
>>> c.is_normal(Decimal('0.1E-999'))
False
>>> c.is_normal(Decimal('0.00'))
False
>>> c.is_normal(Decimal('-Inf'))
False
>>> c.is_normal(Decimal('NaN'))
False
>>> c.is_normal(1)
True
rr~)rrxrws&&r0rx�Context.is_normal�s!��(
�1�d�+���{�{�4�{�(�(r2c�>�[UP	Q5oUO2!)aReturn True if the operand is a quiet NaN; otherwise return False.

>>> ExtendedContext.is_qnan(Decimal('2.50'))
False
>>> ExtendedContext.is_qnan(Decimal('NaN'))
True
>>> ExtendedContext.is_qnan(Decimal('sNaN'))
False
>>> ExtendedContext.is_qnan(1)
False
r)rr�rws&&r0r��Context.is_qnan�s��
�1�d�+���y�y�{�r2c�>�[UP	Q5oUO2!)a)Return True if the operand is negative; otherwise return False.

>>> ExtendedContext.is_signed(Decimal('2.50'))
False
>>> ExtendedContext.is_signed(Decimal('-12'))
True
>>> ExtendedContext.is_signed(Decimal('-0'))
True
>>> ExtendedContext.is_signed(8)
False
>>> ExtendedContext.is_signed(-8)
True
r)rr}rws&&r0r}�Context.is_signed�s��
�1�d�+���{�{�}�r2c�>�[UP	Q5oUO2!)aReturn True if the operand is a signaling NaN;
otherwise return False.

>>> ExtendedContext.is_snan(Decimal('2.50'))
False
>>> ExtendedContext.is_snan(Decimal('NaN'))
False
>>> ExtendedContext.is_snan(Decimal('sNaN'))
True
>>> ExtendedContext.is_snan(1)
False
r)rr�rws&&r0r��Context.is_snan�s��
�1�d�+���y�y�{�r2c�B�[UP	Q5oUOUQ5!)atReturn True if the operand is subnormal; otherwise return False.

>>> c = ExtendedContext.copy()
>>> c.Emin = -999
>>> c.Emax = 999
>>> c.is_subnormal(Decimal('2.50'))
False
>>> c.is_subnormal(Decimal('0.1E-999'))
True
>>> c.is_subnormal(Decimal('0.00'))
False
>>> c.is_subnormal(Decimal('-Inf'))
False
>>> c.is_subnormal(Decimal('NaN'))
False
>>> c.is_subnormal(1)
False
rr~)rr�rws&&r0r��Context.is_subnormals!��&
�1�d�+���~�~�d�~�+�+r2c�>�[UP	Q5oUO2!)aReturn True if the operand is a zero; otherwise return False.

>>> ExtendedContext.is_zero(Decimal('0'))
True
>>> ExtendedContext.is_zero(Decimal('2.50'))
False
>>> ExtendedContext.is_zero(Decimal('-0E+2'))
True
>>> ExtendedContext.is_zero(1)
False
>>> ExtendedContext.is_zero(0)
True
r)rr�rws&&r0r��Context.is_zeros��
�1�d�+���y�y�{�r2c�B�[UP	Q5oUOUQ5!)a~Returns the natural (base e) logarithm of the operand.

>>> c = ExtendedContext.copy()
>>> c.Emin = -999
>>> c.Emax = 999
>>> c.ln(Decimal('0'))
Decimal('-Infinity')
>>> c.ln(Decimal('1.000'))
Decimal('0')
>>> c.ln(Decimal('2.71828183'))
Decimal('1.00000000')
>>> c.ln(Decimal('10'))
Decimal('2.30258509')
>>> c.ln(Decimal('+Infinity'))
Decimal('Infinity')
>>> c.ln(1)
Decimal('0')
rr~)rr�rws&&r0r��
Context.ln(s!��&
�1�d�+���t�t�D�t�!�!r2c�B�[UP	Q5oUOUQ5!)a�Returns the base 10 logarithm of the operand.

>>> c = ExtendedContext.copy()
>>> c.Emin = -999
>>> c.Emax = 999
>>> c.log10(Decimal('0'))
Decimal('-Infinity')
>>> c.log10(Decimal('0.001'))
Decimal('-3')
>>> c.log10(Decimal('1.000'))
Decimal('0')
>>> c.log10(Decimal('2'))
Decimal('0.301029996')
>>> c.log10(Decimal('10'))
Decimal('1')
>>> c.log10(Decimal('70'))
Decimal('1.84509804')
>>> c.log10(Decimal('+Infinity'))
Decimal('Infinity')
>>> c.log10(0)
Decimal('-Infinity')
>>> c.log10(1)
Decimal('0')
rr~)rr�rws&&r0r��
Context.log10>s!��2
�1�d�+���w�w�t�w�$�$r2c�B�[UP	Q5oUOUQ5!)a�Returns the exponent of the magnitude of the operand's MSD.

The result is the integer which is the exponent of the magnitude
of the most significant digit of the operand (as though the
operand were truncated to a single digit while maintaining the
value of that digit and without limiting the resulting exponent).

>>> ExtendedContext.logb(Decimal('250'))
Decimal('2')
>>> ExtendedContext.logb(Decimal('2.50'))
Decimal('0')
>>> ExtendedContext.logb(Decimal('0.03'))
Decimal('-2')
>>> ExtendedContext.logb(Decimal('0'))
Decimal('-Infinity')
>>> ExtendedContext.logb(1)
Decimal('0')
>>> ExtendedContext.logb(10)
Decimal('1')
>>> ExtendedContext.logb(100)
Decimal('2')
rr~)rr�rws&&r0r��Context.logbZs!��.
�1�d�+���v�v�d�v�#�#r2c�B�[UP	Q5oUOV Q5!)a�Applies the logical operation 'and' between each operand's digits.

The operands must be both logical numbers.

>>> ExtendedContext.logical_and(Decimal('0'), Decimal('0'))
Decimal('0')
>>> ExtendedContext.logical_and(Decimal('0'), Decimal('1'))
Decimal('0')
>>> ExtendedContext.logical_and(Decimal('1'), Decimal('0'))
Decimal('0')
>>> ExtendedContext.logical_and(Decimal('1'), Decimal('1'))
Decimal('1')
>>> ExtendedContext.logical_and(Decimal('1100'), Decimal('1010'))
Decimal('1000')
>>> ExtendedContext.logical_and(Decimal('1111'), Decimal('10'))
Decimal('10')
>>> ExtendedContext.logical_and(110, 1101)
Decimal('100')
>>> ExtendedContext.logical_and(Decimal(110), 1101)
Decimal('100')
>>> ExtendedContext.logical_and(110, Decimal(1101))
Decimal('100')
rr~)rr�r�s&&&r0r��Context.logical_andt�!��0
�1�d�+���}�}�Q�}�-�-r2c�B�[UP	Q5oUOUQ5!)a�Invert all the digits in the operand.

The operand must be a logical number.

>>> ExtendedContext.logical_invert(Decimal('0'))
Decimal('111111111')
>>> ExtendedContext.logical_invert(Decimal('1'))
Decimal('111111110')
>>> ExtendedContext.logical_invert(Decimal('111111111'))
Decimal('0')
>>> ExtendedContext.logical_invert(Decimal('101010101'))
Decimal('10101010')
>>> ExtendedContext.logical_invert(1101)
Decimal('111110010')
rr~)rr�rws&&r0r��Context.logical_invert�s$�� 
�1�d�+�������-�-r2c�B�[UP	Q5oUOV Q5!)a�Applies the logical operation 'or' between each operand's digits.

The operands must be both logical numbers.

>>> ExtendedContext.logical_or(Decimal('0'), Decimal('0'))
Decimal('0')
>>> ExtendedContext.logical_or(Decimal('0'), Decimal('1'))
Decimal('1')
>>> ExtendedContext.logical_or(Decimal('1'), Decimal('0'))
Decimal('1')
>>> ExtendedContext.logical_or(Decimal('1'), Decimal('1'))
Decimal('1')
>>> ExtendedContext.logical_or(Decimal('1100'), Decimal('1010'))
Decimal('1110')
>>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10'))
Decimal('1110')
>>> ExtendedContext.logical_or(110, 1101)
Decimal('1111')
>>> ExtendedContext.logical_or(Decimal(110), 1101)
Decimal('1111')
>>> ExtendedContext.logical_or(110, Decimal(1101))
Decimal('1111')
rr~)rr�r�s&&&r0r��Context.logical_or�s!��0
�1�d�+���|�|�A�|�,�,r2c�B�[UP	Q5oUOV Q5!)a�Applies the logical operation 'xor' between each operand's digits.

The operands must be both logical numbers.

>>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0'))
Decimal('0')
>>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1'))
Decimal('1')
>>> ExtendedContext.logical_xor(Decimal('1'), Decimal('0'))
Decimal('1')
>>> ExtendedContext.logical_xor(Decimal('1'), Decimal('1'))
Decimal('0')
>>> ExtendedContext.logical_xor(Decimal('1100'), Decimal('1010'))
Decimal('110')
>>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10'))
Decimal('1101')
>>> ExtendedContext.logical_xor(110, 1101)
Decimal('1011')
>>> ExtendedContext.logical_xor(Decimal(110), 1101)
Decimal('1011')
>>> ExtendedContext.logical_xor(110, Decimal(1101))
Decimal('1011')
rr~)rr�r�s&&&r0r��Context.logical_xor�r�r2c�B�[UP	Q5oUOV Q5!)amax compares two values numerically and returns the maximum.

If either operand is a NaN then the general rules apply.
Otherwise, the operands are compared as though by the compare
operation.  If they are numerically equal then the left-hand operand
is chosen as the result.  Otherwise the maximum (closer to positive
infinity) of the two operands is chosen as the result.

>>> ExtendedContext.max(Decimal('3'), Decimal('2'))
Decimal('3')
>>> ExtendedContext.max(Decimal('-10'), Decimal('3'))
Decimal('3')
>>> ExtendedContext.max(Decimal('1.0'), Decimal('1'))
Decimal('1')
>>> ExtendedContext.max(Decimal('7'), Decimal('NaN'))
Decimal('7')
>>> ExtendedContext.max(1, 2)
Decimal('2')
>>> ExtendedContext.max(Decimal(1), 2)
Decimal('2')
>>> ExtendedContext.max(1, Decimal(2))
Decimal('2')
rr~)rrPr�s&&&r0rP�Context.max��!��0
�1�d�+���u�u�Q�u�%�%r2c�B�[UP	Q5oUOV Q5!)aoCompares the values numerically with their sign ignored.

>>> ExtendedContext.max_mag(Decimal('7'), Decimal('NaN'))
Decimal('7')
>>> ExtendedContext.max_mag(Decimal('7'), Decimal('-10'))
Decimal('-10')
>>> ExtendedContext.max_mag(1, -2)
Decimal('-2')
>>> ExtendedContext.max_mag(Decimal(1), -2)
Decimal('-2')
>>> ExtendedContext.max_mag(1, Decimal(-2))
Decimal('-2')
rr~)rr�r�s&&&r0r��Context.max_mag��!��
�1�d�+���y�y��y�)�)r2c�B�[UP	Q5oUOV Q5!)amin compares two values numerically and returns the minimum.

If either operand is a NaN then the general rules apply.
Otherwise, the operands are compared as though by the compare
operation.  If they are numerically equal then the left-hand operand
is chosen as the result.  Otherwise the minimum (closer to negative
infinity) of the two operands is chosen as the result.

>>> ExtendedContext.min(Decimal('3'), Decimal('2'))
Decimal('2')
>>> ExtendedContext.min(Decimal('-10'), Decimal('3'))
Decimal('-10')
>>> ExtendedContext.min(Decimal('1.0'), Decimal('1'))
Decimal('1.0')
>>> ExtendedContext.min(Decimal('7'), Decimal('NaN'))
Decimal('7')
>>> ExtendedContext.min(1, 2)
Decimal('1')
>>> ExtendedContext.min(Decimal(1), 2)
Decimal('1')
>>> ExtendedContext.min(1, Decimal(29))
Decimal('1')
rr~)rr(r�s&&&r0r(�Context.minr�r2c�B�[UP	Q5oUOV Q5!)alCompares the values numerically with their sign ignored.

>>> ExtendedContext.min_mag(Decimal('3'), Decimal('-2'))
Decimal('-2')
>>> ExtendedContext.min_mag(Decimal('-3'), Decimal('NaN'))
Decimal('-3')
>>> ExtendedContext.min_mag(1, -2)
Decimal('1')
>>> ExtendedContext.min_mag(Decimal(1), -2)
Decimal('1')
>>> ExtendedContext.min_mag(1, Decimal(-2))
Decimal('1')
rr~)rr�r�s&&&r0r��Context.min_magr�r2c�B�[UP	Q5oUOUQ5!)a~Minus corresponds to unary prefix minus in Python.

The operation is evaluated using the same rules as subtract; the
operation minus(a) is calculated as subtract('0', a) where the '0'
has the same exponent as the operand.

>>> ExtendedContext.minus(Decimal('1.3'))
Decimal('-1.3')
>>> ExtendedContext.minus(Decimal('-1.3'))
Decimal('1.3')
>>> ExtendedContext.minus(1)
Decimal('-1')
rr~)rrFrws&&r0�minus�
Context.minus0�!��
�1�d�+���y�y��y�&�&r2c�~�[UP	Q5oUOV Q5oU[Ic[QU*2gU!)a8multiply multiplies two operands.

If either operand is a special value then the general rules apply.
Otherwise, the operands are multiplied together
('long multiplication'), resulting in a number which may be as long
as the sum of the lengths of the two operands.

>>> ExtendedContext.multiply(Decimal('1.20'), Decimal('3'))
Decimal('3.60')
>>> ExtendedContext.multiply(Decimal('7'), Decimal('3'))
Decimal('21')
>>> ExtendedContext.multiply(Decimal('0.9'), Decimal('0.8'))
Decimal('0.72')
>>> ExtendedContext.multiply(Decimal('0.9'), Decimal('-0'))
Decimal('-0.0')
>>> ExtendedContext.multiply(Decimal('654321'), Decimal('654321'))
Decimal('4.28135971E+11')
>>> ExtendedContext.multiply(7, 7)
Decimal('49')
>>> ExtendedContext.multiply(Decimal(7), 7)
Decimal('49')
>>> ExtendedContext.multiply(7, Decimal(7))
Decimal('49')
rr~rz)rrbr�r�r{s&&& r0�multiply�Context.multiplyAs>��2
�1�d�+��
�I�I�a�I�&������=��A�B�B��Hr2c�B�[UP	Q5oUOUQ5!)a�Returns the largest representable number smaller than a.

>>> c = ExtendedContext.copy()
>>> c.Emin = -999
>>> c.Emax = 999
>>> ExtendedContext.next_minus(Decimal('1'))
Decimal('0.999999999')
>>> c.next_minus(Decimal('1E-1007'))
Decimal('0E-1007')
>>> ExtendedContext.next_minus(Decimal('-1.00000003'))
Decimal('-1.00000004')
>>> c.next_minus(Decimal('Infinity'))
Decimal('9.99999999E+999')
>>> c.next_minus(1)
Decimal('0.999999999')
rr~)rr�rws&&r0r��Context.next_minusas!��"
�1�d�+���|�|�D�|�)�)r2c�B�[UP	Q5oUOUQ5!)a�Returns the smallest representable number larger than a.

>>> c = ExtendedContext.copy()
>>> c.Emin = -999
>>> c.Emax = 999
>>> ExtendedContext.next_plus(Decimal('1'))
Decimal('1.00000001')
>>> c.next_plus(Decimal('-1E-1007'))
Decimal('-0E-1007')
>>> ExtendedContext.next_plus(Decimal('-1.00000003'))
Decimal('-1.00000002')
>>> c.next_plus(Decimal('-Infinity'))
Decimal('-9.99999999E+999')
>>> c.next_plus(1)
Decimal('1.00000001')
rr~)rr�rws&&r0r��Context.next_plusus!��"
�1�d�+���{�{�4�{�(�(r2c�B�[UP	Q5oUOV Q5!)a�Returns the number closest to a, in direction towards b.

The result is the closest representable number from the first
operand (but not the first operand) that is in the direction
towards the second operand, unless the operands have the same
value.

>>> c = ExtendedContext.copy()
>>> c.Emin = -999
>>> c.Emax = 999
>>> c.next_toward(Decimal('1'), Decimal('2'))
Decimal('1.00000001')
>>> c.next_toward(Decimal('-1E-1007'), Decimal('1'))
Decimal('-0E-1007')
>>> c.next_toward(Decimal('-1.00000003'), Decimal('0'))
Decimal('-1.00000002')
>>> c.next_toward(Decimal('1'), Decimal('0'))
Decimal('0.999999999')
>>> c.next_toward(Decimal('1E-1007'), Decimal('-100'))
Decimal('0E-1007')
>>> c.next_toward(Decimal('-1.00000003'), Decimal('-10'))
Decimal('-1.00000004')
>>> c.next_toward(Decimal('0.00'), Decimal('-0.0000'))
Decimal('-0.00')
>>> c.next_toward(0, 1)
Decimal('1E-1007')
>>> c.next_toward(Decimal(0), 1)
Decimal('1E-1007')
>>> c.next_toward(0, Decimal(1))
Decimal('1E-1007')
rr~)rr�r�s&&&r0r��Context.next_toward�s"��@
�1�d�+���}�}�Q�}�-�-r2c�B�[UP	Q5oUOUQ5!)a+normalize reduces an operand to its simplest form.

Essentially a plus operation with all trailing zeros removed from the
result.

>>> ExtendedContext.normalize(Decimal('2.1'))
Decimal('2.1')
>>> ExtendedContext.normalize(Decimal('-2.0'))
Decimal('-2')
>>> ExtendedContext.normalize(Decimal('1.200'))
Decimal('1.2')
>>> ExtendedContext.normalize(Decimal('-120'))
Decimal('-1.2E+2')
>>> ExtendedContext.normalize(Decimal('120.00'))
Decimal('1.2E+2')
>>> ExtendedContext.normalize(Decimal('0.00'))
Decimal('0')
>>> ExtendedContext.normalize(6)
Decimal('6')
rr~)rr!rws&&r0r!�Context.normalize�s!��*
�1�d�+���{�{�4�{�(�(r2c�B�[UP	Q5oUOUQ5!)a�Returns an indication of the class of the operand.

The class is one of the following strings:
  -sNaN
  -NaN
  -Infinity
  -Normal
  -Subnormal
  -Zero
  +Zero
  +Subnormal
  +Normal
  +Infinity

>>> c = ExtendedContext.copy()
>>> c.Emin = -999
>>> c.Emax = 999
>>> c.number_class(Decimal('Infinity'))
'+Infinity'
>>> c.number_class(Decimal('1E-10'))
'+Normal'
>>> c.number_class(Decimal('2.50'))
'+Normal'
>>> c.number_class(Decimal('0.1E-999'))
'+Subnormal'
>>> c.number_class(Decimal('0'))
'+Zero'
>>> c.number_class(Decimal('-0'))
'-Zero'
>>> c.number_class(Decimal('-0.1E-999'))
'-Subnormal'
>>> c.number_class(Decimal('-1E-10'))
'-Normal'
>>> c.number_class(Decimal('-2.50'))
'-Normal'
>>> c.number_class(Decimal('-Infinity'))
'-Infinity'
>>> c.number_class(Decimal('NaN'))
'NaN'
>>> c.number_class(Decimal('-NaN'))
'NaN'
>>> c.number_class(Decimal('sNaN'))
'sNaN'
>>> c.number_class(123)
'+Normal'
rr~)rr�rws&&r0r��Context.number_class�s"��^
�1�d�+���~�~�d�~�+�+r2c�B�[UP	Q5oUOUQ5!)aoPlus corresponds to unary prefix plus in Python.

The operation is evaluated using the same rules as add; the
operation plus(a) is calculated as add('0', a) where the '0'
has the same exponent as the operand.

>>> ExtendedContext.plus(Decimal('1.3'))
Decimal('1.3')
>>> ExtendedContext.plus(Decimal('-1.3'))
Decimal('-1.3')
>>> ExtendedContext.plus(-1)
Decimal('-1')
rr~)rrIrws&&r0�plus�Context.plus�r�r2c��[UP	Q5oUOV#UQ5oU[Ic[QU*2gU!)a�Raises a to the power of b, to modulo if given.

With two arguments, compute a**b.  If a is negative then b
must be integral.  The result will be inexact unless b is
integral and the result is finite and can be expressed exactly
in 'precision' digits.

With three arguments, compute (a**b) % modulo.  For the
three argument form, the following restrictions on the
arguments hold:

 - all three arguments must be integral
 - b must be nonnegative
 - at least one of a or b must be nonzero
 - modulo must be nonzero and have at most 'precision' digits

The result of pow(a, b, modulo) is identical to the result
that would be obtained by computing (a**b) % modulo with
unbounded precision, but is computed more efficiently.  It is
always exact.

>>> c = ExtendedContext.copy()
>>> c.Emin = -999
>>> c.Emax = 999
>>> c.power(Decimal('2'), Decimal('3'))
Decimal('8')
>>> c.power(Decimal('-2'), Decimal('3'))
Decimal('-8')
>>> c.power(Decimal('2'), Decimal('-3'))
Decimal('0.125')
>>> c.power(Decimal('1.7'), Decimal('8'))
Decimal('69.7575744')
>>> c.power(Decimal('10'), Decimal('0.301029996'))
Decimal('2.00000000')
>>> c.power(Decimal('Infinity'), Decimal('-1'))
Decimal('0')
>>> c.power(Decimal('Infinity'), Decimal('0'))
Decimal('1')
>>> c.power(Decimal('Infinity'), Decimal('1'))
Decimal('Infinity')
>>> c.power(Decimal('-Infinity'), Decimal('-1'))
Decimal('-0')
>>> c.power(Decimal('-Infinity'), Decimal('0'))
Decimal('1')
>>> c.power(Decimal('-Infinity'), Decimal('1'))
Decimal('-Infinity')
>>> c.power(Decimal('-Infinity'), Decimal('2'))
Decimal('Infinity')
>>> c.power(Decimal('0'), Decimal('0'))
Decimal('NaN')

>>> c.power(Decimal('3'), Decimal('7'), Decimal('16'))
Decimal('11')
>>> c.power(Decimal('-3'), Decimal('7'), Decimal('16'))
Decimal('-11')
>>> c.power(Decimal('-3'), Decimal('8'), Decimal('16'))
Decimal('1')
>>> c.power(Decimal('3'), Decimal('7'), Decimal('-16'))
Decimal('11')
>>> c.power(Decimal('23E12345'), Decimal('67E189'), Decimal('123456789'))
Decimal('11729830')
>>> c.power(Decimal('-0'), Decimal('17'), Decimal('1729'))
Decimal('-0')
>>> c.power(Decimal('-23'), Decimal('0'), Decimal('65537'))
Decimal('1')
>>> ExtendedContext.power(7, 7)
Decimal('823543')
>>> ExtendedContext.power(Decimal(7), 7)
Decimal('823543')
>>> ExtendedContext.power(7, Decimal(7), 2)
Decimal('1')
rr~rz)rrr�r�)r8rr�r�ros&&&& r0�power�
Context.powersA��R
�1�d�+��
�I�I�a��I�.������=��A�B�B��Hr2c�B�[UP	Q5oUOV Q5!)a�Returns a value equal to 'a' (rounded), having the exponent of 'b'.

The coefficient of the result is derived from that of the left-hand
operand.  It may be rounded using the current rounding setting (if
the exponent is being increased), multiplied by a positive power of
ten (if the exponent is being decreased), or is unchanged (if the
exponent is already equal to that of the right-hand operand).

Unlike other operations, if the length of the coefficient after the
quantize operation would be greater than precision then an Invalid
operation condition is raised.  This guarantees that, unless there
is an error condition, the exponent of the result of a quantize is
always equal to that of the right-hand operand.

Also unlike other operations, quantize will never raise Underflow,
even if the result is subnormal and inexact.

>>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.001'))
Decimal('2.170')
>>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.01'))
Decimal('2.17')
>>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.1'))
Decimal('2.2')
>>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+0'))
Decimal('2')
>>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+1'))
Decimal('0E+1')
>>> ExtendedContext.quantize(Decimal('-Inf'), Decimal('Infinity'))
Decimal('-Infinity')
>>> ExtendedContext.quantize(Decimal('2'), Decimal('Infinity'))
Decimal('NaN')
>>> ExtendedContext.quantize(Decimal('-0.1'), Decimal('1'))
Decimal('-0')
>>> ExtendedContext.quantize(Decimal('-0'), Decimal('1e+5'))
Decimal('-0E+5')
>>> ExtendedContext.quantize(Decimal('+35236450.6'), Decimal('1e-2'))
Decimal('NaN')
>>> ExtendedContext.quantize(Decimal('-35236450.6'), Decimal('1e-2'))
Decimal('NaN')
>>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-1'))
Decimal('217.0')
>>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-0'))
Decimal('217')
>>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+1'))
Decimal('2.2E+2')
>>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+2'))
Decimal('2E+2')
>>> ExtendedContext.quantize(1, 2)
Decimal('1')
>>> ExtendedContext.quantize(Decimal(1), 2)
Decimal('1')
>>> ExtendedContext.quantize(1, Decimal(2))
Decimal('1')
rr~)rr�r�s&&&r0r��Context.quantizeWs"��n
�1�d�+���z�z�!�z�*�*r2c��[]
2!)zSJust returns 10, as this is Decimal, :)

>>> ExtendedContext.radix()
Decimal('10')
r�r�s&r0r��
Context.radix�s���r�{�r2c�~�[UP	Q5oUOV Q5oU[Ic[QU*2gU!)aFReturns the remainder from integer division.

The result is the residue of the dividend after the operation of
calculating integer division as described for divide-integer,
rounded to precision digits if necessary.  The sign of the result,
if non-zero, is the same as that of the original dividend.

This operation will fail under the same conditions as integer
division (that is, if integer division on the same two operands
would fail, the remainder cannot be calculated).

>>> ExtendedContext.remainder(Decimal('2.1'), Decimal('3'))
Decimal('2.1')
>>> ExtendedContext.remainder(Decimal('10'), Decimal('3'))
Decimal('1')
>>> ExtendedContext.remainder(Decimal('-10'), Decimal('3'))
Decimal('-1')
>>> ExtendedContext.remainder(Decimal('10.2'), Decimal('1'))
Decimal('0.2')
>>> ExtendedContext.remainder(Decimal('10'), Decimal('0.3'))
Decimal('0.1')
>>> ExtendedContext.remainder(Decimal('3.6'), Decimal('1.3'))
Decimal('1.0')
>>> ExtendedContext.remainder(22, 6)
Decimal('4')
>>> ExtendedContext.remainder(Decimal(22), 6)
Decimal('4')
>>> ExtendedContext.remainder(22, Decimal(6))
Decimal('4')
rr~rz)rr�r�r�r{s&&& r0rh�Context.remainder�s>��>
�1�d�+��
�I�I�a�I�&������=��A�B�B��Hr2c�B�[UP	Q5oUOV Q5!)aoReturns to be "a - b * n", where n is the integer nearest the exact
value of "x / b" (if two integers are equally near then the even one
is chosen).  If the result is equal to 0 then its sign will be the
sign of a.

This operation will fail under the same conditions as integer
division (that is, if integer division on the same two operands
would fail, the remainder cannot be calculated).

>>> ExtendedContext.remainder_near(Decimal('2.1'), Decimal('3'))
Decimal('-0.9')
>>> ExtendedContext.remainder_near(Decimal('10'), Decimal('6'))
Decimal('-2')
>>> ExtendedContext.remainder_near(Decimal('10'), Decimal('3'))
Decimal('1')
>>> ExtendedContext.remainder_near(Decimal('-10'), Decimal('3'))
Decimal('-1')
>>> ExtendedContext.remainder_near(Decimal('10.2'), Decimal('1'))
Decimal('0.2')
>>> ExtendedContext.remainder_near(Decimal('10'), Decimal('0.3'))
Decimal('0.1')
>>> ExtendedContext.remainder_near(Decimal('3.6'), Decimal('1.3'))
Decimal('-0.3')
>>> ExtendedContext.remainder_near(3, 11)
Decimal('3')
>>> ExtendedContext.remainder_near(Decimal(3), 11)
Decimal('3')
>>> ExtendedContext.remainder_near(3, Decimal(11))
Decimal('3')
rr~)rr�r�s&&&r0r��Context.remainder_near�s$��>
�1�d�+�������0�0r2c�B�[UP	Q5oUOV Q5!)a�Returns a rotated copy of a, b times.

The coefficient of the result is a rotated copy of the digits in
the coefficient of the first operand.  The number of places of
rotation is taken from the absolute value of the second operand,
with the rotation being to the left if the second operand is
positive or to the right otherwise.

>>> ExtendedContext.rotate(Decimal('34'), Decimal('8'))
Decimal('400000003')
>>> ExtendedContext.rotate(Decimal('12'), Decimal('9'))
Decimal('12')
>>> ExtendedContext.rotate(Decimal('123456789'), Decimal('-2'))
Decimal('891234567')
>>> ExtendedContext.rotate(Decimal('123456789'), Decimal('0'))
Decimal('123456789')
>>> ExtendedContext.rotate(Decimal('123456789'), Decimal('+2'))
Decimal('345678912')
>>> ExtendedContext.rotate(1333333, 1)
Decimal('13333330')
>>> ExtendedContext.rotate(Decimal(1333333), 1)
Decimal('13333330')
>>> ExtendedContext.rotate(1333333, Decimal(1))
Decimal('13333330')
rr~)rr�r�s&&&r0r��Context.rotate�s!��4
�1�d�+���x�x��x�(�(r2c�@�[UP	Q5oUOU2!)aUReturns True if the two operands have the same exponent.

The result is never affected by either the sign or the coefficient
of either operand.

>>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.001'))
False
>>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.01'))
True
>>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('1'))
False
>>> ExtendedContext.same_quantum(Decimal('Inf'), Decimal('-Inf'))
True
>>> ExtendedContext.same_quantum(10000, -1)
True
>>> ExtendedContext.same_quantum(Decimal(10000), -1)
True
>>> ExtendedContext.same_quantum(10000, Decimal(-1))
True
r)rr'r�s&&&r0r'�Context.same_quantum�s��*
�1�d�+���~�~�a� � r2c�B�[UP	Q5oUOV Q5!)a�Returns the first operand after adding the second value its exp.

>>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('-2'))
Decimal('0.0750')
>>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('0'))
Decimal('7.50')
>>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('3'))
Decimal('7.50E+3')
>>> ExtendedContext.scaleb(1, 4)
Decimal('1E+4')
>>> ExtendedContext.scaleb(Decimal(1), 4)
Decimal('1E+4')
>>> ExtendedContext.scaleb(1, Decimal(4))
Decimal('1E+4')
rr~)rr�r�s&&&r0r��Context.scalebs!�� 
�1�d�+���x�x��x�(�(r2c�B�[UP	Q5oUOV Q5!)a�Returns a shifted copy of a, b times.

The coefficient of the result is a shifted copy of the digits
in the coefficient of the first operand.  The number of places
to shift is taken from the absolute value of the second operand,
with the shift being to the left if the second operand is
positive or to the right otherwise.  Digits shifted into the
coefficient are zeros.

>>> ExtendedContext.shift(Decimal('34'), Decimal('8'))
Decimal('400000000')
>>> ExtendedContext.shift(Decimal('12'), Decimal('9'))
Decimal('0')
>>> ExtendedContext.shift(Decimal('123456789'), Decimal('-2'))
Decimal('1234567')
>>> ExtendedContext.shift(Decimal('123456789'), Decimal('0'))
Decimal('123456789')
>>> ExtendedContext.shift(Decimal('123456789'), Decimal('+2'))
Decimal('345678900')
>>> ExtendedContext.shift(88888888, 2)
Decimal('888888800')
>>> ExtendedContext.shift(Decimal(88888888), 2)
Decimal('888888800')
>>> ExtendedContext.shift(88888888, Decimal(2))
Decimal('888888800')
rr~)rrgr�s&&&r0rg�
Context.shift)s!��6
�1�d�+���w�w�q�w�'�'r2c�B�[UP	Q5oUOUQ5!)a�Square root of a non-negative number to context precision.

If the result must be inexact, it is rounded using the
round-half-even algorithm.

>>> ExtendedContext.sqrt(Decimal('0'))
Decimal('0')
>>> ExtendedContext.sqrt(Decimal('-0'))
Decimal('-0')
>>> ExtendedContext.sqrt(Decimal('0.39'))
Decimal('0.624499800')
>>> ExtendedContext.sqrt(Decimal('100'))
Decimal('10')
>>> ExtendedContext.sqrt(Decimal('1'))
Decimal('1')
>>> ExtendedContext.sqrt(Decimal('1.0'))
Decimal('1.0')
>>> ExtendedContext.sqrt(Decimal('1.00'))
Decimal('1.0')
>>> ExtendedContext.sqrt(Decimal('7'))
Decimal('2.64575131')
>>> ExtendedContext.sqrt(Decimal('10'))
Decimal('3.16227766')
>>> ExtendedContext.sqrt(2)
Decimal('1.41421356')
>>> ExtendedContext.prec
9
rr~)rr<rws&&r0r<�Context.sqrtGs!��:
�1�d�+���v�v�d�v�#�#r2c�~�[UP	Q5oUOV Q5oU[Ic[QU*2gU!)a�Return the difference between the two operands.

>>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.07'))
Decimal('0.23')
>>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.30'))
Decimal('0.00')
>>> ExtendedContext.subtract(Decimal('1.3'), Decimal('2.07'))
Decimal('-0.77')
>>> ExtendedContext.subtract(8, 5)
Decimal('3')
>>> ExtendedContext.subtract(Decimal(8), 5)
Decimal('3')
>>> ExtendedContext.subtract(8, Decimal(5))
Decimal('3')
rr~rz)rrYr�r�r{s&&& r0�subtract�Context.subtractgs>�� 
�1�d�+��
�I�I�a�I�&������=��A�B�B��Hr2c�B�[UP	Q5oUOUQ5!)a�Convert to a string, using engineering notation if an exponent is needed.

Engineering notation has an exponent which is a multiple of 3.  This
can leave up to 3 digits to the left of the decimal place and may
require the addition of either one or two trailing zeros.

The operation is not affected by the context.

>>> ExtendedContext.to_eng_string(Decimal('123E+1'))
'1.23E+3'
>>> ExtendedContext.to_eng_string(Decimal('123E+3'))
'123E+3'
>>> ExtendedContext.to_eng_string(Decimal('123E-10'))
'12.3E-9'
>>> ExtendedContext.to_eng_string(Decimal('-123E-12'))
'-123E-12'
>>> ExtendedContext.to_eng_string(Decimal('7E-7'))
'700E-9'
>>> ExtendedContext.to_eng_string(Decimal('7E+1'))
'70'
>>> ExtendedContext.to_eng_string(Decimal('0E+1'))
'0.00E+3'

rr~)rr?rws&&r0r?�Context.to_eng_string~s!��2
�1�d�+�����t��,�,r2c�B�[UP	Q5oUOUQ5!)ziConverts a number to a string, using scientific notation.

The operation is not affected by the context.
rr~)rr;rws&&r0�
to_sci_string�Context.to_sci_string�s!��

�1�d�+���y�y��y�&�&r2c�B�[UP	Q5oUOUQ5!)a�Rounds to an integer.

When the operand has a negative exponent, the result is the same
as using the quantize() operation using the given operand as the
left-hand-operand, 1E+0 as the right-hand-operand, and the precision
of the operand as the precision setting; Inexact and Rounded flags
are allowed in this operation.  The rounding mode is taken from the
context.

>>> ExtendedContext.to_integral_exact(Decimal('2.1'))
Decimal('2')
>>> ExtendedContext.to_integral_exact(Decimal('100'))
Decimal('100')
>>> ExtendedContext.to_integral_exact(Decimal('100.0'))
Decimal('100')
>>> ExtendedContext.to_integral_exact(Decimal('101.5'))
Decimal('102')
>>> ExtendedContext.to_integral_exact(Decimal('-101.5'))
Decimal('-102')
>>> ExtendedContext.to_integral_exact(Decimal('10E+5'))
Decimal('1.0E+6')
>>> ExtendedContext.to_integral_exact(Decimal('7.89E+77'))
Decimal('7.89E+77')
>>> ExtendedContext.to_integral_exact(Decimal('-Inf'))
Decimal('-Infinity')
rr~)rr2rws&&r0r2�Context.to_integral_exact�s$��6
�1�d�+���"�"�4�"�0�0r2c�B�[UP	Q5oUOUQ5!)a�Rounds to an integer.

When the operand has a negative exponent, the result is the same
as using the quantize() operation using the given operand as the
left-hand-operand, 1E+0 as the right-hand-operand, and the precision
of the operand as the precision setting, except that no flags will
be set.  The rounding mode is taken from the context.

>>> ExtendedContext.to_integral_value(Decimal('2.1'))
Decimal('2')
>>> ExtendedContext.to_integral_value(Decimal('100'))
Decimal('100')
>>> ExtendedContext.to_integral_value(Decimal('100.0'))
Decimal('100')
>>> ExtendedContext.to_integral_value(Decimal('101.5'))
Decimal('102')
>>> ExtendedContext.to_integral_value(Decimal('-101.5'))
Decimal('-102')
>>> ExtendedContext.to_integral_value(Decimal('10E+5'))
Decimal('1.0E+6')
>>> ExtendedContext.to_integral_value(Decimal('7.89E+77'))
Decimal('7.89E+77')
>>> ExtendedContext.to_integral_value(Decimal('-Inf'))
Decimal('-Infinity')
rr~)rr�rws&&r0r��Context.to_integral_value�s$��4
�1�d�+���"�"�4�"�0�0r2)	rrr�r,r7r�rrqrpr�)	NNNNNNNNNr-)r�)[r=r>r?r@rArr5r9r1r@r�r.r�rRr7r�r�r�r�rargrrer�r8rqrtr�r|rrOrrRr@r^rBr�rCrer�r�rfr�r�rlror&rrxr�r}r�r�r�r�r�r�r�r�r�r�rPr�r(r�r�r�r�r�r�r!r�r�r�r�r�rhr�r�r'r�rgr<r�r?r�r2r�rrBrCrDs@r0rr
s������$"�H5�	1�I�2<�;�"�!�
!�
���H�!�,-��-��H�.�.��&�"�$'�*�*!��#*�J!1�F"�:&�����0#�J�.�*#�0)�. ��,
�� )�.
��"� ,�,�""�,%�8$�4.�6.�&-�6.�6&�6*�"&�6*�"'�"�@*�()�(!.�F)�00,�d'�"N�`8+�t�$�L 1�D)�:!�0)�&(�<$�@�.-�8'�1�<1�<$�Kr2c�6`�\sQsQsnQsQQksQsQsUsP!)r�i�c�:�UePUm]UmPUmP![U[2%c?UO
Um[UO2UmUOUmP!U]*UmU]*UmU]*UmP!r-)r]r�r�r�rrNrOr�)r8r�s&&r0r�_WorkRep.__init__�sq���=��D�I��D�H��D�H�
��w�
'�
'����D�I��5�:�:��D�H��z�z�D�H��a��D�I��Q�x�D�H��Q�x�D�Hr2c�^�QUO8QUO8QUO8Q0!)�(rFrH�r]r�r�r�s&r0r.�_WorkRep.__repr__�s��!%���D�H�H�d�h�h�?�?r2)r�r�r]rr-)	r=r>r?r@r	rr.rBrCrDs@r0r�r��s����$�I�

 �@�@r2r�c��UOUO6cSoSoLSoSo[[UO22o[[UO22oUO[	PVR*
]*
2*oVdO*]*
U6c]UmVtmU9O]
UOUO*
**tmUOUmV1!)z[Normalizes op1, op2 to have the same exp and length of coefficient.

Done during addition.
)r�r�r�r�r()rTrUrq�tmpr��tmp_len�	other_lenr�s&&&     r0rRrR�s���
�w�w��������������#�c�g�g�,��G��C��	�	�N�#�I�

�'�'�C��G�N�Q�.�/�
/�C��9�9��q� �3�&���	��	��G�G�r�c�g�g��	�	�)�*�*�G��i�i�C�G��8�Or2c���U]6Xc]!U]6�cU]
U**![[U22o[U2[UOQ22*
oV1'6cP!U]
U'**!)z�Given integers n and e, return n * 10**e if it's an integer, else None.

The computation is designed to avoid computing large powers of 10
unnecessarily.

>>> _decimal_lshift_exact(3, 4)
30000
>>> _decimal_lshift_exact(300, -999999999)  # returns None

r�)r�r�r��rstrip)rLr4�str_n�val_ns&&  r0r�r�si��	�A�v��	
�a���2�q�5�y���C��F����E�
�S����c�!2�3�3���r�z�t�2�q�B���F�{�2r2c�~�U]6:fU]6:c[Q2g]oV6wcXU'U**
]*	qJ U!)z�Closest integer to the square root of the positive integer n.  a is
an initial approximation to the square root.  Any positive integer
will do for a, but the closer a is to the square root of n the
faster convergence will be.

z3Both arguments to _sqrt_nearest should be positive.)r�)rLrr�s&& r0�
_sqrt_nearestr/s?��	�A�v��a���N�O�O��A�
�&��Q�B��E�'�1�*�1��Hr2c��]U*V*	q2U]V]*
**U]**U6�*!)z�Given an integer x and a nonnegative integer shift, return closest
integer to x / 2**shift; use round-to-even in case of a tie.

r.)r�rgr�rns&&  r0�_rshift_nearestr>s4��

��:�q�z�q���1�!��9�
��1��%��)�*�*r2c�`�[V2vq#U]U*U]**U6�*!)zYClosest integer to a/b, a and b positive integers; rounds to even
in the case of a tie.

)rf)rr�rnros&&  r0�_div_nearestrFs*��
�!�<�D�A���!��q��s��a�� � r2c�l�V*
o]oVB6:c[U2V$*
*U6�f$VB6�ci[U2VB*
*	U6�cL[V*]*U[V[V42**U2*2oU]*
oJ�[	Q[[
U22*]U**2'o[V42o[V2o[U]*
]P2FD%o[V2[Vg*U2*
oJ'	[Vs*U2!)a�Integer approximation to M*log(x/M), with absolute error boundable
in terms only of x/M.

Given positive integers x and M, return an integer approximation to
M * log(x/M).  For L = 8 and 0.1 <= x/M <= 10 the difference
between the approximation and the exact result is at most 22.  For
L = 8 and 1.0 <= x/M <= 10.0 the difference is at most 15.  In
both cases these are upper bounds on the error; it will usually be
much smaller.���)r�rrrr�r�r�r�)	r��M�Lr��R�T�yshift�wr�s	&&&      r0�_ilogr Ns���<	
��A�	�A��6�c�!�f���m�q�(��5�S��V�q�s�]�a�'��!�#�!���]�1���0E�.E�+F��J�J�
L��	�Q���

�S��S��V��_�q��s�
#�	$�$�A�
�Q�
"�F��Q��A�
�1�Q�3��2�
������f�h��!:�:������Q��r2c��U]*
o[[U22oV*V*]6�*
oU]6�cv]
U*oV*U*
oU]6�cU]
U**oL[U]
U'*2o[V2o[	U2o[Vu*U2oVE*o	L]o[U]
U'*2o	[V�*]d2!)z�Given integers c, e and p with c > 0, p >= 0, compute an integer
approximation to 10**p * log10(c*10**e), with an absolute error of
at most 1.  Assumes that c*10**e is not exactly 1.)r�r�rr �
_log10_digits)
r:r4r�r;r�rr��log_d�log_10�log_tenpowers
&&&       r0r�r�~s�����F�A�	�C��F��A�	��q�s�a�x��A��1�u���E��
�C��E����6�
��Q��J�A��Q��Q�B��'�A��a����q�!���U�W�f�-���s����#�A�r�A�2�v�.����*�C�0�0r2c��U]*
o[[U22oV*V*]6�*
oU]6�cPV*U*
oU]6�cU]
U**oL[U]
U'*2o[U]
U*2oL]oU%c_[[[	U222]*
oV'*]6�c+[U[V'*2*]
U*2oL]oL]o[V�*]d2!)z�Given integers c, e and p with c > 0, compute an integer
approximation to 10**p * log(c*10**e), with an absolute error of
at most 1.  Assumes that c*10**e is not exactly 1.)r�r�rr r�r")	r:r4r�r;r�r�r#r�	f_log_tens	&&&      r0r�r��s�����F�A�
	�C��F��A�	��q�s�a�x��A�	�1�u�
�C��E����6�
��Q��J�A��Q��Q�B��'�A��a��Q������	��C��A��K� ��"���9��>�%�Q�}�Q�W�'=�%=�r�5�y�I�I��I��	��	�)�3�/�/r2c�2`�\sQsQsnQsQsQsQsUsP!)�
_Log10Memoizei�z�Class to compute, store, and allow retrieval of, digits of the
constant log(10) = 2.302585....  This constant is needed by
Decimal.ln, Decimal.log10, Decimal.exp and Decimal.__pow__.c��QUmP!)�/23025850929940456840179914546843642076011014886�r�r�s&r0r�_Log10Memoize.__init__�s	��G��r2c��U]6c[Q2gU[UO26�cv]o]
V*]**o[[	[]
U*U2]d22oVB'PQU*6wcLU]*
oJZUO
Q2PPUm[UOPU]*2!)zdGiven an integer p >= 0, return floor(10**p)*log(10).

For example, self.getdigits(3) returns 2302.
zp should be nonnegativer�)r�r�r�r�rr rr�)r8r�rrr�s&&   r0�	getdigits�_Log10Memoize.getdigits�s���
�q�5��6�7�7���D�K�K� � ��E�������O���\�%��1��a�.�#�>�?���&�'�?�c�%�i�/����
��!�-�-��,�S�b�1�D�K��4�;�;�t��!��$�%�%r2r,)	r=r>r?r@rArr/rBrCrDs@r0r)r)�s����C�H�&�&r2r)c���[V*U*2o[Q[[U22*]U**2'o[	V2oV*o[U]*
]P2FD"o[	VU**Vg*2oJ$	[U]*
PP2FD+oV]**o[	VUU**U2oJ-	V*!)z�Given integers x and M, M > 0, such that x/M is small in absolute
value, compute an integer approximation to M*exp(x/M).  For 0 <=
x/M <= 2.4, the absolute error in the result is bounded by 60 (and
is usually much smaller).r)r�r�r�r�rr�)	r�rrrrr��Mshiftr�r�s	&&&      r0�_iexpr3�s���*	���q�y��A�

�S��S��V��_�q��s�
#�	$�$�A��Q��A�
�T�F�
�1�Q�3��2�
����Q�J����4����1�Q�3��B�
���q�S�����f�H��v�.�� �
�3�Jr2c	��U]*
o[]U[[U22*]*
2oV#*oV*oU]6�cU]
U**oLU]
U'**o[U[	U22vqx[U]
U*2o[[
U]
U*2Q2Vr*
]*1!)a�Compute an approximation to exp(c*10**e), with p decimal places of
precision.

Returns integers d, f such that:

  10**(p-1) <= d <= 10**p, and
  (d-1)*10**f < exp(c*10**e) < (d+1)*10**f

In other words, d*10**f is an approximation to exp(c*10**e) with p
digits of precision, and with an error in d of at most 1.  This is
almost, but not quite, the same as the error being < 1ulp: when d
= 10**(p-1) the error could be up to 10 ulp.��)rPr�r�rfr"rr3)	r:r4r�rrnrg�cshift�quotrs	&&&      r0rhrhs�����F�A�
��1�s�3�q�6�{�?�Q�&�'�E�	�	�A�
�C�E���z��2�u�9����B���J����v�}�Q�/�0�I�D��s�B��I�
&�C���c�2�q�5�)�4�0�$�(�Q�,�>�>r2c�2�[[[U222U*o[VVE*]*2oV5*
oU]6�cVb*]
U**oL[	Vb*]
U'*2oU]6Xc_[[U22U*]6�U]6�6Xc#]
U]*
*]*]U*
q�V�1!]
U*]*
U'q�V�1![V�]*'U]*2vq�[	U	]
2o	U
]*
o
V�1!)aGiven integers xc, xe, yc and ye representing Decimals x = xc*10**xe and
y = yc*10**ye, compute x**y.  Returns a pair of integers (c, e) such that:

  10**(p-1) <= c <= 10**p, and
  (c-1)*10**e < x**y < (c+1)*10**e

in other words, c*10**e is an approximation to x**y with p digits
of precision, and with an error in c of at most 1.  (This is
almost, but not quite, the same as the error being < 1ulp: when c
== 10**(p-1) we can only guarantee error < 10ulp.)

We assume that: x is positive and not equal to 1, and y is nonzero.
)r�r�r�r�rrh)r�r�rrr�r��lxcrg�pcr�r�s&&&&&      r0rr:s��� 	�C��B��L��B��A�����A��
�C�
�D�E���z�
�V�B��I�
��
�#�&�"�u�f�*�
-��	�Q�w���R��\�B�
�!�
#��a��0��a��c��1��a��c�3��:��
�Q��q��1�"�3��:��	�2�1��v�q��s�+�
���U�B�'���q����:�r2r_�2�3�4�5�6�7�8roc��U]6:c[Q2g[U2o]d[U2*V]***
!)z@Compute a lower bound for 100*log10(c) for a positive integer c.z0The argument to _log10_lb should be nonnegative.)r�r�r�)r:�
correction�str_cs&& r0r�r�ds:��	�A�v��K�L�L���F�E��s�5�z�>�J�Q�x�0�0�0r2c��[U[2%cU![U[2%c[U2!U%c,[U[2%c[O	U2!U%c[QU*2g[!)z�Convert other to Decimal.

Verifies that it's ok to use in an implicit construction.
If allow_float is true, allow conversion from float;  this
is used in the comparison methods (__eq__ and friends).

rz)r�rr�r�r�r�r�)r�r�allow_floats&&&r0rrosg���%��!�!����%�����u�~���z�%��/�/��!�!�%�(�(���9�E�A�B�B��r2c���[U[2%cV1![U[O2%cxUO%fO[UO[[UO2UO*2UO2oU[UO21!U%c>[U[O2%cUO]6Xc
UOo[U[ 2%cT[#2oU%c]UO$[&$LUO)[&Q2U[O+U21![,[,1!)z�Given a Decimal instance self and a Python object other, return
a pair (s, o) of Decimal instances such that "s op o" is
equivalent to "self op other" for any of the 6 comparison
operators "op".

r�)r�r�_numbers�Rationalr�rMrNr�r�rO�denominatorr��	numerator�Complexr�r�r�rrrr�r�r�)r8r�r�r9s&&& r0r�r��s���%��!�!��{���%��*�*�+�+�����#�D�J�J�$'��D�I�I���9J�9J�(J�$K�$(�I�I�/�D��W�U�_�_�-�-�-�
�z�%��)9�)9�:�:�u�z�z�Q���
�
���%�����,���,-�G�M�M�.�)�� � ��M�
O��W�'�'��.�.�.��>�)�)r2i?B)rqrpr�rrrr�r7r�)rqrpr�ra�        # A numeric string consists of:
#    \s*
    (?P<sign>[-+])?              # an optional sign, followed by either...
    (
        (?=\d|\.\d)              # ...a number (with at least one digit)
        (?P<int>\d*)             # having a (possibly empty) integer part
        (\.(?P<frac>\d*))?       # followed by an optional fractional part
        (E(?P<exp>[-+]?\d+))?    # followed by an optional exponent, or...
    |
        Inf(inity)?              # ...an infinity, or...
    |
        (?P<signal>s)?           # ...an (optionally signaling)
        NaN                      # NaN
        (?P<diag>\d*)            # with (possibly empty) diagnostic info.
    )
#    \s*
    \z
z0*$z50*$a*\A
(?:
   (?P<fill>.)?
   (?P<align>[<>=^])
)?
(?P<sign>[-+ ])?
(?P<no_neg_0>z)?
(?P<alt>\#)?
(?P<zeropad>0)?
(?P<minimumwidth>\d+)?
(?P<thousands_sep>[,_])?
(?:\.
    (?=[\d,_])  # lookahead for digit or separator
    (?P<precision>\d+)?
    (?P<frac_separators>[,_])?
)?
(?P<type>[eEfFgGn%])?
\z
c��[OU2oUe[QU*2gUO2oUQ*oUQ*oUQ*PIUQ$UQ*%c-Ud[QU*2gUd[QU*2gS9%fQUQ$S9%fQUQ$UQ	*eQ
UQ	$[	UQ*9%fQ2UQ$UQ
*d[	UQ
*2UQ
$UQ
*]6XcUQ*dUQ*Q7c]UQ
$UQ*Q6XcaQUQ$Ue[
O2oUQ*d[QU*2gUQ*UQ$UQ*UQ$UQ*UQ$LUQ*ePUQ$]],UQ$QUQ$UQ*ePUQ$U!)a�Parse and validate a format specifier.

Turns a standard numeric format specifier into a dict, with the
following entries:

  fill: fill character to pad field to minimum width
  align: alignment type, either '<', '>', '=' or '^'
  sign: either '+', '-' or ' '
  minimumwidth: nonnegative integer giving minimum width
  zeropad: boolean, indicating whether to pad with zeros
  thousands_sep: string to use as thousands separator, or ''
  grouping: grouping for thousands separators, in format
    used by localeconv
  decimal_point: string to use for decimal point
  precision: nonnegative integer giving precision, or None
  type: one of the characters 'eEfFgG%', or None

zInvalid format specifier: �fill�align�zeropadz7Fill character conflicts with '0' in format specifier: z2Alignment conflicts with '0' in format specifier: � �>r]r��minimumwidthr�r�r��gGnrLr��
thousands_sepzJExplicit thousands separator conflicts with 'n' type in format specifier: �grouping�
decimal_pointr3�frac_separators)�_parse_format_specifier_regex�matchr��	groupdictr��_locale�
localeconv)�format_specr�r��format_dictrNrOs&&    r0r�r�s$��&	&�+�+�K�8�A��y��5��C�D�D��+�+�-�K��v��D��� �E�)�)�4�D�@�K�	���9������6�8C�D�E�
E����2�4?�@�A�
A��+�+�#�K���!�<�<�C�K����6��"�!��F��#&�k�.�&A�&H�&H�S�"I�K����;��+�#&�{�;�'?�#@��K� ��;��1�$��v��&�+�f�*=��*F�'(�K��$��6��c�!�!��F����!�,�,�.�K���'�3��>�@K�L�M�
M�'2�?�'C��O�$�"-�j�"9��J��'2�?�'C��O�$���'�/�+-�K��(�#$�a�&��J��'*��O�$��$�%�-�)+��%�&��r2c��UQ*oUQ*oVC[U2*
[U2*
*oUQ*oUQ6XcV*U*oU!UQ6XcVP*U*oU!UQ6XcV*U*oU!UQ6Xc1[U2]*oUPUU*U*VXP*oU![Q2g)	z�Given an unpadded, non-aligned numeric string 'body' and sign
string 'sign', add padding and alignment conforming to the given
format specifier dictionary 'spec' (as produced by
parse_format_specifier).

rSrNrO�<rR�=�^zUnrecognised alignment field)r�r�)	r]rrrSrN�paddingrOr��halfs	&&&      r0rrgs�����'�L���<�D��3�t�9�,�s�4�y�8�9�G���M�E���|���w�&���M�
�#����$�&���M�
�#����$�&���M�

�#���7�|�Q�����$��$�&��-����>���M��7�8�8r2c���]QHGoGoU%f,!UP*]6Xc*[U2]6�cUUPPUUQ*22!UP*[O
6XcUPP![
Q2g)zqConvert a localeconv-style grouping into a (possibly infinite)
iterable of integers representing group lengths.

)�chain�repeatz unrecognised format for groupingr)�	itertoolsrgrhr�r\�CHAR_MAXr�)rVrgrhs&  r0�_group_lengthsrk�sl��(���	�	�"���	�s�8�}��1��X�c�r�]�F�8�B�<�$8�9�9�	�"���)�)�	)����}���;�<�<r2c	�B�UQ*oUQ*o,o[U2FD�oU]6:c[Q2g[[[	U2U]2U2oUOQU[	U2*
*V'P*2UPU'oV&*oU%fU]6:cL^U[	U2*oJ�	[[	U2U]2oUOQU[	U2*
*V'P*2UO
[U22!)aFInsert thousands separators into a digit string.

spec is a dictionary whose keys should include 'thousands_sep' and
'grouping'; typically it's the result of parsing the format
specifier using _parse_format_specifier.

The min_width keyword argument gives the minimum length of the
result, which will be padded on the left with zeros if necessary.

If necessary, the zero padding adds an extra '0' on the left to
avoid a leading thousands separator.  For example, inserting
commas every three digits in '123456', with min_width=8, gives
'0,123,456', even though that has length 9.

rUrVzgroup length should be positiver�)rkr�r(rPr�r�r��reversed)r�r�	min_width�seprV�groupsr;s&&&    r0�_insert_thousands_seprq�s���"��
�C��J��H�
�F�
�H�
%����6��>�?�?���C��K��A�.��2���
�
�c�1�s�6�{�?�+�f�R�S�k�9�:���!������	��)�q�.���S��X��	�&�
��F��Y��*���
�
�c�1�s�6�{�?�+�f�R�S�k�9�:��8�8�H�V�$�%�%r2c�J�U%cQ!UQ*Q7c
UQ*!P!)zDetermine sign character.r�r]z +r.)�is_negativers&&r0rr�s#����	
�f���	��F�|��r2c	�d`�[V2oUQ*oR%c7U%c/UOU1Qk[][R2]222nR%fUQ*%cUQ*R*nU]6wfUQ*Q7c1QQQQQ	QQ
Q-UQ**oRQO	Vs2*
nUQ*Q6Xc
RQ*
nUQ
*%c+UQ*[R2*
[U2*
oL]o[VU2o[
VQR*U2!)a/Format a number, given the following data:

is_negative: true if the number is negative, else false
intpart: string of digits that must appear before the decimal point
fracpart: string of digits that must come after the point
exp: exponent, as an integer
spec: dictionary resulting from parsing the format specifier

This function uses the information in spec to:
  insert separators (decimal separator and thousands separators)
  format the sign
  format the exponent
  add trailing '%' for the '%' type
  zero-pad if necessary
  fill and align if necessary
rXc3�F:�SF �DoRV]*w�	J	P!3h)�r.)r%�posr�s& �r0r&�!_format_number.<locals>.<genexpr>�s��,F���,F�S�"*�#�A�g�!6�,F�s�!�altrWr�r�r5r4r�r�z{0}{1:+}r�rPrS)rr�r�r��formatrqr)	rsr�r�r�rr]�frac_sep�echarrns	&&f&&    r0rr�s	���$��*�D��%�&�H��H��=�=�!H�,1�!�S��]�A�,F�!H�H���4��;�;���(�8�3��
�a�x�4��<�4�'��c�3��S�#�s�C�8��f��F���J�%�%�e�1�1���F�|�s���C����I�����(�3�x�=�8�3�t�9�D�	��	�#�G�9�=�G���x�/��6�6r2�Infz-Infr2c�l�UQ6Xc]QHGoUQQQ5[![Q[8QU802g)�__version__)�_deprecated)rfzmodule z has no attribute )rv�)�warningsr�r(r=r=)r2r�s& r0�__getattr__r�s6���}��(��M�'�2���
�7�8�,�.@���I�
J�Jr2l����l������N�Zoi���)rqr�rrr7r�rprr�r-rr�)r�)FFi���)r�)rA�__all__r=�	__xname__r(�__libmpdec_version__�mathr��numbersrH�sys�collectionsr*�_namedtupler�ImportErrorrrrrrrrrr&r'�maxsizer!r"r#r%r$�ArithmeticErrorrrr	r�ZeroDivisionErrorr
rrrrrr
rrr�rr�r[r<�contextvars�
ContextVarrz�	frozensetr�rrrr r�rrM�Number�registerr�rr�rRr�r�r�r�rrrr r�r�r)r/r"r3rhrr�rr�rrr�re�compile�VERBOSE�
IGNORECASErZr�r�r��DOTALLrY�localer\r�rrkrqrrr�r�rQrVr
rUr[�	hash_info�modulusrr�rr��_PyHASH_NANrrr�r.r2r0�<module>r�s��� '�$�
�$��$�
�$��$�%�$�'8�$��$�"�$�$6�$�8H�$��$��$�&�$�(2�$�4?�$��$� �!$� +�!$� -?�!$� AT�!$�&�'$�&"�'$�&$5�'$�&7F�'$�(�)$�(�)$�( 1�)$�(3?�)$�.�/$�.�/$�.!/�/$�.1>�/$�4�5$�4�5$�4(�5$�4*5�5$�47N�5$�:�;$�@�A$�F�G$��L
�	���������
�&�5��~�/E�i�X�L�
�
��
�#���
�����#��
�
������;�;�'��!�H�!�H�"�H����H��H��H������
�#�	�
��
�.
��
��'��:�'��%�%�'8�%� 	�)�	�	�(�*;�	�
��
�
�%�
�
��
�	� �	�#:�w��#:�L
���)�
��%�y��"
�^�W�h���'��N�D��#�#3�$�%5�#�$4� �!1�3���}�o�}���/�:�G���"�-�-�.?�@���O����&��+�\�6^4K�f�^4K�@i�&	������!�

'�f�
'�Q$�f�Q$�f6@�v�@�4�<

����3�*

�+�!�. �` 1�D*0�X!&�F�!&�F��)�)�
�#�J"?�H(�V	�S�#�r�3��C��S�"��R��b�#�r�3��+�1��&"*�T�
�/��x�)9�:��
�
������
���x�)9�7�I�N�����
������*
�
�*�*��"�Z�Z�"�-�-��#!�""'��#�&�Z�Z��
�
$�
$�
��j�j�� �&�&��!#�
�
�,�$�Z�Z��	�	��%!��(�
	��Q�f�6=�.#&�J�(7�\
�E�N�	��F�O���u�~����
���q�z���r�{���/�0���-�-�'�'���m�m�����m�m�����B��!�+�_�=�
��K��MF�&�%�L�&��X~�	��	�s0�+O*�O;�*O8�0O8�7O8�;P�P�P

Youez - 2016 - github.com/yon3zu
LinuXploit