%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/python3.9/site-packages/numpy/core/__pycache__/
Upload File :
Create Path :
Current File : //lib64/python3.9/site-packages/numpy/core/__pycache__/getlimits.cpython-39.pyc

a

z[yc<^�
@sjdZddgZddlZddlmZddlmZddlmZdd	lm	Z
dd
lmZmZm
Z
ddlmZmZmZmZdd
�Zdd�ZGdd�d�Ze
je
je
je
je
je
jiZdZe
jee
j de�!d�d�e
jee
j"de�!d�d�e
j#ee
j$de�!d�d�e
j%ee
j&de�!d�d�iZ'iZ(dd�Z)iZ*dd�Z+d d!�Z,d"d#�Z-ed$�Gd%d�d��Z.ed$�Gd&d�d��Z/dS)'zJMachine limits for Float32 and Float64 and (long double) if available...

�finfo�iinfo�N�)�MachAr)�
set_module)�numeric)�numerictypes)�array�inf�NaN)�log10�exp2�	nextafter�isnancCs|jdkr|��}d|_|S)zfix rank-0 --> rank-1r)r)�ndim�copy�shape��a�r�:/usr/lib64/python3.9/site-packages/numpy/core/getlimits.py�_fr0s
rcCs|jdkr|��}d|_|S)zfix rank > 0 --> rank-0rr)�sizerrrrrr�_fr1s
rc@sNeZdZdZdd�dd�Zedd��Zedd	��Zd
d�Zdd
�Z	dd�Z
dS)�
MachArLikez$ Object to simulate MachAr instance N)�smallest_subnormalc	Ks4t||_||_|jd|_|s@t|�d�|�d�|jd�|_n||_|�|�|_|_|�|�|_	|�|�|_
|_|�|�|_|�|�|_
|_|jd|�|_|j�|�tt|j��|_|�|�d�|j�|_|�|j�|_|�|j	�|_|�|j�|_|�|j
�|_|�|j�|_|�|j�|_dS)N�titlerr��dtype�itype�
)�_MACHAR_PARAMS�params�ftyperr�_smallest_subnormal�_float_to_float�epsilon�eps�epsnegZxmax�hugeZxmin�smallest_normal�tiny�ibeta�__dict__�update�intr�	precision�_float_conv�
resolution�
_float_to_str�_str_eps�_str_epsneg�	_str_xmin�	_str_xmax�_str_resolution�_str_smallest_normal)	�selfr#r'r(r)r+r,r�kwargsrrr�__init__"s2
�
�zMachArLike.__init__cCs6|j}|�d�|kr,tjd�|j�tdd�|�|�S)a Return the value for the smallest subnormal.

        Returns
        -------
        smallest_subnormal : float
            value for the smallest subnormal.

        Warns
        -----
        UserWarning
            If the calculated value for the smallest subnormal is zero.
        rz8The value of the smallest subnormal for {} type is zero.���
stacklevel)r$r#�warnings�warn�format�UserWarningr%�r:�valuerrrr>s��zMachArLike.smallest_subnormalcCs|�|j�S)z;Return the string representation of the smallest subnormal.)r3r�r:rrr�_str_smallest_subnormalVsz"MachArLike._str_smallest_subnormalcCst|�|��S)z�Converts float to float.

        Parameters
        ----------
        value : float
            value to be converted.
        )rr1rDrrrr%[szMachArLike._float_to_floatcCst|g|j�S)z�Converts float to conv.

        Parameters
        ----------
        value : float
            value to be converted.
        )r	r#rDrrrr1eszMachArLike._float_convcCs|jdtt|�d|j�S)zConverts float to str.

        Parameters
        ----------
        value : float
            value to be converted.
        �fmtr)r"r	rr#rDrrrr3oszMachArLike._float_to_str)�__name__�
__module__�__qualname__�__doc__r<�propertyrrGr%r1r3rrrrr s�



rz(numpy {} precision floating point numberz%24.16e�double)rrHrz%15.7e�singlez%szlong doublez%12.5e�halfcCs|t|<dS�N)�_KNOWN_TYPES)�macharZbytepatrrr�_register_type�srTcCs�tj}t|dddddddddt|d��t|d��|d	�|d
�d�}t|d�|td<tj}t|d
ddddddddt|d
��t|d��|ddd�t|d��d�}t|d�|td<tj}d}d}t|dddddddddd|d|||d �|d�}t|d!�|td"<tj}t|d#��}	t|d$��}
t	j
d%d&��(|d'�|	|
|d �}Wd�n1�sb0Yt|d(d#d$d)d*d+dddt|d(��|	||
d�}t|d,�t|d,�|td<t|d-��}
t|d$��}t	j
d%d&��(|d'�|
||d �}Wd�n1�s0Yt|d.d-d$d)d/d+dddt|d.��|
||d�}t|d0�|td1<t|t�|d�|d2�}t
}|td3d��}t|d4d5ddd6ddddt|d4��t|d5��|||d7�}t|d8�t|d9�|td:<dS);Ni����i����i��r �r=ri�g?)
�machep�negep�minexp�maxexp�it�iexpr,�irnd�ngrdr'r(r)r+sf�i��i��i�������g��?s��̽� g�<gi���i���i���i�4�g�<g�?�s���������@i����i����ignore)�allri����i@�p�s����������������i����i�����?s
����������Prgi����i�����i)rWrXrYrZr[r\r,r]r^r'r(r)r+rs������Y<��������s��������������Y<�dd)�ntypesZfloat16rr
rT�	_float_maZfloat32Zfloat64�
longdoublerZerrstaterr
r)Zf16Z
float16_maZf32Z
float32_maZf64Z
epsneg_f64Ztiny_f64Z
float64_maZldZepsneg_f128Z	tiny_f128Z	huge_f128Zfloat128_maZ
epsneg_f80Ztiny_f80Zhuge_f80Z
float80_maZhuge_ddZsmallest_normal_ddZsmallest_subnormal_ddZfloat_dd_marrr�_register_known_types�s

�



�
�
8
���8
�


���rrcCs�t�|�}|durtt|���|d��d���}d}|tjkrPt�|dd��}|durbt�|�}|durn|St	j
d|�d|�d�tdd	�t|�S)
a� Get MachAr instance or MachAr-like instance

    Get parameters for floating point type, by first trying signatures of
    various known floating point types, then, if none match, attempting to
    identify parameters by analysis.

    Parameters
    ----------
    ftype : class
        Numpy floating point type class (e.g. ``np.float64``)

    Returns
    -------
    ma_like : instance of :class:`MachAr` or :class:`MachArLike`
        Object giving floating point parameters for `ftype`.

    Warns
    -----
    UserWarning
        If the binary signature of the float type is not in the dictionary of
        known float types.
    Nz-0.1�<r z
Signature z for zz does not match any known type: falling back to type probe function.
This warnings indicates broken support for the dtype!r=r>)
r!�get�
ValueError�reprZnewbyteorder�tobytesrorqrRr@rArC�_discovered_machar)r#r"�keyZma_likerrr�_get_machar1s 


�rzcs>t��t�fdd��fdd��fdd���fdd��d�S)zB Create MachAr instance with found information on float types
    cst|g��SrQ)r	��v�r#rr�<lambda>e�z$_discovered_machar.<locals>.<lambda>cst|��d��dS)Nrr)rZastyper{)r"rrr~frcstt|�d��S)Nr�r	rr{r}rrr~grcs�dtt|�d��S)NrHrr�r{�r#r"rrr~hrr)r!rr}rr�rrxas

�rxZnumpyc@sXeZdZdZiZdd�Zdd�Zdd�Zdd	�Ze	d
d��Z
e	dd
��Ze	dd��ZdS)ra7
    finfo(dtype)

    Machine limits for floating point types.

    Attributes
    ----------
    bits : int
        The number of bits occupied by the type.
    eps : float
        The difference between 1.0 and the next smallest representable float
        larger than 1.0. For example, for 64-bit binary floats in the IEEE-754
        standard, ``eps = 2**-52``, approximately 2.22e-16.
    epsneg : float
        The difference between 1.0 and the next smallest representable float
        less than 1.0. For example, for 64-bit binary floats in the IEEE-754
        standard, ``epsneg = 2**-53``, approximately 1.11e-16.
    iexp : int
        The number of bits in the exponent portion of the floating point
        representation.
    machar : MachAr
        The object which calculated these parameters and holds more
        detailed information.

        .. deprecated:: 1.22
    machep : int
        The exponent that yields `eps`.
    max : floating point number of the appropriate type
        The largest representable number.
    maxexp : int
        The smallest positive power of the base (2) that causes overflow.
    min : floating point number of the appropriate type
        The smallest representable number, typically ``-max``.
    minexp : int
        The most negative power of the base (2) consistent with there
        being no leading 0's in the mantissa.
    negep : int
        The exponent that yields `epsneg`.
    nexp : int
        The number of bits in the exponent including its sign and bias.
    nmant : int
        The number of bits in the mantissa.
    precision : int
        The approximate number of decimal digits to which this kind of
        float is precise.
    resolution : floating point number of the appropriate type
        The approximate decimal resolution of this type, i.e.,
        ``10**-precision``.
    tiny : float
        An alias for `smallest_normal`, kept for backwards compatibility.
    smallest_normal : float
        The smallest positive floating point number with 1 as leading bit in
        the mantissa following IEEE-754 (see Notes).
    smallest_subnormal : float
        The smallest positive floating point number with 0 as leading bit in
        the mantissa following IEEE-754.

    Parameters
    ----------
    dtype : float, dtype, or instance
        Kind of floating point data-type about which to get information.

    See Also
    --------
    MachAr : The implementation of the tests that produce this information.
    iinfo : The equivalent for integer data types.
    spacing : The distance between a value and the nearest adjacent number
    nextafter : The next floating point value after x1 towards x2

    Notes
    -----
    For developers of NumPy: do not instantiate this at the module level.
    The initial calculation of these parameters is expensive and negatively
    impacts import times.  These objects are cached, so calling ``finfo()``
    repeatedly inside your functions is not a problem.

    Note that ``smallest_normal`` is not actually the smallest positive
    representable value in a NumPy floating point type. As in the IEEE-754
    standard [1]_, NumPy floating point types make use of subnormal numbers to
    fill the gap between 0 and ``smallest_normal``. However, subnormal numbers
    may have significantly reduced precision [2]_.

    References
    ----------
    .. [1] IEEE Standard for Floating-Point Arithmetic, IEEE Std 754-2008,
           pp.1-70, 2008, http://www.doi.org/10.1109/IEEESTD.2008.4610935
    .. [2] Wikipedia, "Denormal Numbers",
           https://en.wikipedia.org/wiki/Denormal_number
    cCszt�|�}Wn ty.t�t|��}Yn0|j�|d�}|durJ|S|g}t�|�}||urp|�|�|}t|tj	�s�t
d|��|j�|d�}|dur�|St|tj�s�t|}||ur�|�|�|}|j�|d�}|dur�|St
�|��|�}|D]}||j|<q�|S)Nzdata type %r not inexact)rr�	TypeError�type�_finfo_cachertZ
obj2sctype�append�
issubclassZinexactruZfloating�_convert_to_float�object�__new__�_init)�clsr�objZdtypesZnewdtypeZdtrrrr��s:


z
finfo.__new__cCs�t�|�|_t|�}dD]}t||t||��qdD]}t||t||�jd�q4|jjd|_|jjd|_	|j	|_
|jjd|_|j|_
|j|_||_|j��|_|j��|_|j��|_|j��|_|j��|_|j��|_|j��|_|S)N)r0r\rZrYrXrW)r2r(rrra)rrrz�setattr�getattr�flat�itemsize�bitsr)�max�minr'r\Znexpr[Znmant�_macharr6�stripZ	_str_tinyr7Z_str_maxr5r4r8r9rG)r:rrSZwordrrrr��s*
zfinfo._initcCsd}||jS)Na+Machine parameters for %(dtype)s
---------------------------------------------------------------
precision = %(precision)3s   resolution = %(_str_resolution)s
machep = %(machep)6s   eps =        %(_str_eps)s
negep =  %(negep)6s   epsneg =     %(_str_epsneg)s
minexp = %(minexp)6s   tiny =       %(_str_tiny)s
maxexp = %(maxexp)6s   max =        %(_str_max)s
nexp =   %(nexp)6s   min =        -max
smallest_normal = %(_str_smallest_normal)s   smallest_subnormal = %(_str_smallest_subnormal)s
---------------------------------------------------------------
)r-�r:rHrrr�__str__s�
z
finfo.__str__cCs"|jj}|j��}||d<d|S)N�klasszZ%(klass)s(resolution=%(resolution)s, min=-%(_str_max)s, max=%(_str_max)s, dtype=%(dtype)s))�	__class__rIr-r)r:�c�drrr�__repr__s
�zfinfo.__repr__cCs0t|jjjd�r"tjdtdd�|jjjdS)a7Return the value for the smallest normal.

        Returns
        -------
        smallest_normal : float
            Value for the smallest normal.

        Warns
        -----
        UserWarning
            If the calculated value for the smallest normal is requested for
            double-double.
        rz;The value of smallest normal is undefined for double doubler=r>)rr�r*r�r@rArCrFrrrr*s�zfinfo.smallest_normalcCs|jS)aQReturn the value for tiny, alias of smallest_normal.

        Returns
        -------
        tiny : float
            Value for the smallest normal, alias of smallest_normal.

        Warns
        -----
        UserWarning
            If the calculated value for the smallest normal is requested for
            double-double.
        )r*rFrrrr+3sz
finfo.tinycCstjdtdd�|jS)z�The object which calculated these parameters and holds more
        detailed information.

        .. deprecated:: 1.22
        z)`finfo.machar` is deprecated (NumPy 1.22)r=r>)r@rA�DeprecationWarningr�rFrrrrSDs
�zfinfo.macharN)
rIrJrKrLr�r�r�r�r�rMr*r+rSrrrrrlsZ!

c@sHeZdZdZiZiZdd�Zedd��Zedd��Z	dd	�Z
d
d�ZdS)
ral
    iinfo(type)

    Machine limits for integer types.

    Attributes
    ----------
    bits : int
        The number of bits occupied by the type.
    min : int
        The smallest integer expressible by the type.
    max : int
        The largest integer expressible by the type.

    Parameters
    ----------
    int_type : integer type, dtype, or instance
        The kind of integer data type to get information about.

    See Also
    --------
    finfo : The equivalent for floating point data types.

    Examples
    --------
    With types:

    >>> ii16 = np.iinfo(np.int16)
    >>> ii16.min
    -32768
    >>> ii16.max
    32767
    >>> ii32 = np.iinfo(np.int32)
    >>> ii32.min
    -2147483648
    >>> ii32.max
    2147483647

    With instances:

    >>> ii32 = np.iinfo(np.int32(10))
    >>> ii32.min
    -2147483648
    >>> ii32.max
    2147483647

    cCs|zt�|�|_Wn"ty2t�t|��|_Yn0|jj|_|jjd|_d|j|jf|_|jdvrxtd|jf��dS)Nraz%s%d�iuzInvalid integer data type %r.)	rrr�r��kindr�r�ryru)r:Zint_typerrrr<�s

ziinfo.__init__cCsZ|jdkrdSztj|j}Wn2tyPtd|jd>�}|tj|j<Yn0|SdS)zMinimum value of given dtype.�urrN)r�r�	_min_valsry�KeyErrorr/r��r:�valrrrr��s
z	iinfo.mincCshztj|j}WnRtyb|jdkr<td|j>d�}ntd|jd>d�}|tj|j<Yn0|S)zMaximum value of given dtype.r�r)r�	_max_valsryr�r�r/r�r�rrrr��s
z	iinfo.maxcCsd}||j|j|jd�S)zString representation.z�Machine parameters for %(dtype)s
---------------------------------------------------------------
min = %(min)s
max = %(max)s
---------------------------------------------------------------
�rr�r�r�r�rrrr��s�z
iinfo.__str__cCsd|jj|j|j|jfS)Nz%s(min=%s, max=%s, dtype=%s))r�rIr�r�rrFrrrr��s�ziinfo.__repr__N)rIrJrKrLr�r�r<rMr�r�r�r�rrrrrSs0

)0rL�__all__r@r�rZ	overridesr�rrror	r
rZumathrr
rrrrrZcsinglerOZcomplex_Zfloat_Z
clongfloatZ	longfloatr�Z
_title_fmtrN�dictZint64rBZint32rqZlonglongrPZint16r!rRrTrprrrzrxrrrrrr�<module>sb[������0g

Zerion Mini Shell 1.0