%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/future/builtins/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib/python2.7/site-packages/future/builtins/newround.pyo

�
�A�[c@sZdZddlmZmZmZddlmZmZdd�Z	d�Z
dgZdS(sD
``python-future``: pure Python implementation of Python 3 round().
i����(tPYPYtPY26tbind_method(tDecimaltROUND_HALF_EVENcCs�t}|dkr!t}d}nt|d�r=|j|�S|dkrXtd��ntd�|}tr�dtt	|��kr�t
|�}q�nts�tj|�j
|dt�}nt|�j
|dt�}|r�t|�St
|�SdS(s�
    See Python 3 documentation: uses Banker's Rounding.

    Delegates to the __round__ method if for some reason this exists.

    If not, rounds a number to a given precision in decimal digits (default
    0 digits). This returns an int when called with one argument,
    otherwise the same type as the number. ndigits may be negative.

    See the test_round method in future/tests/test_builtins.py for
    examples.
    it	__round__s"negative ndigits not supported yett10tnumpytroundingN(tFalsetNonetTruethasattrRtNotImplementedErrorRRtreprttypetfloatRt
from_floattquantizeRt
from_float_26tint(tnumbertndigitst
return_inttexponenttd((sI/opt/alt/python27/lib/python2.7/site-packages/future/builtins/newround.pytnewrounds&
	

c	Cs�ddl}ddlm}t|ttf�r;t|�S|j|�sY|j|�ritt	|��S|j
d|�dkr�d}nd}t|�j�\}}d�}||�d}||t
|d|�|�}|S(	s�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')

    i����N(t_dec_from_tripleg�?iicSs.|dkr&ttt|���dSdSdS(Nii(tlentbintabs(R((sI/opt/alt/python27/lib/python2.7/site-packages/future/builtins/newround.pyt
bit_lengthYsi(tmathtdecimalRt
isinstanceRtlongRtisinftisnanRtcopysignRtas_integer_ratiotstr(	tft_mathRtsigntnRRtktresult((sI/opt/alt/python27/lib/python2.7/site-packages/future/builtins/newround.pyR7s
		!RN(t__doc__tfuture.utilsRRRR!RRR
RRt__all__(((sI/opt/alt/python27/lib/python2.7/site-packages/future/builtins/newround.pyt<module>s
+	,

Zerion Mini Shell 1.0