https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/future/builtins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/future/builtins/__pycache__/newround.cpython-310.pyc
o

,1�]m�@sDdZddlmZmZmZddlmZmZd	dd�Zdd�Z	dgZ
dS)
zD
``python-future``: pure Python implementation of Python 3 round().
�)�PYPY�PY26�bind_method)�Decimal�ROUND_HALF_EVENNcCs�d}|dur
d}d}t|d�r|�|�S|dkrtd��td�|}tr1dtt|��vr1t|�}t|t�r9|}nt	sFt�
|�j|td	�}n	t
|�j|td	�}|rUt|�St|�S)
a�
    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.
    FNTr�	__round__z"negative ndigits not supported yet�10�numpy)�rounding)�hasattrr�NotImplementedErrorrr�repr�type�float�
isinstancer�
from_float�quantizer�
from_float_26�int)�number�ndigits�
return_int�exponent�d�r�:/usr/lib/python3/dist-packages/future/builtins/newround.py�newrounds,



�rc	Cs�ddl}ddlm}t|ttf�rt|�S|�|�s|�|�r%tt	|��S|�
d|�dkr0d}nd}t|���\}}dd�}||�d}||t
|d|�|�}|S)	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')

    rN)�_dec_from_tripleg�?�cSs |dkrttt|���dSdS)Nr�)�len�bin�abs)rrrr�
bit_length\sz!from_float_26.<locals>.bit_length�)�math�decimalrrr�longr�isinf�isnanr
�copysignr"�as_integer_ratio�str)	�f�_mathr�sign�nrr#�k�resultrrrr:sr)N)�__doc__�future.utilsrrrr&rrrr�__all__rrrr�<module>s
.
,

https://t.me/RX1948 - 2025