HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/numpy/core/__pycache__/getlimits.cpython-310.pyc
o

6��a>M�
@sjdZddgZddlZddlmZddlmZddlmZdd	lm	Z
dd
lmZmZddl
mZmZddlm
Z
d
d�Zdd�ZGdd�d�Ze
je
je
je
je
je
jiZdZe
jee
jde�d�d�e
jee
jde�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)�log10�exp2)�umathcC�|jdkr|��}d|_|S)zfix rank-0 --> rank-1r)r)�ndim�copy�shape��a�r�6/usr/lib/python3/dist-packages/numpy/core/getlimits.py�_fr0�
rcCr)zfix rank > 0 --> rank-0rr)�sizerrrrrr�_fr1rrc@seZdZdZdd�ZdS)�
MachArLikez$ Object to simulate MachAr instance c
s�t���fdd���fdd�}��fdd�}	�d|_||�|_|_||�|_||�|_|_||�|_|_�d|�|_	|j
�|�tt
|j��|_|�d�|j�|_|	|j�|_|	|j�|_|	|j�|_|	|j�|_|	|j�|_dS)Nc�t|g��S�N�r	��v��ftyperr�<lambda>'�z%MachArLike.__init__.<locals>.<lambda>cst�|��Sr)rr)�
float_convrrr"(r#c��dtt|�d��S�N�fmtr�r	rr�r!�paramsrrr")��title�itype�
)�_MACHAR_PARAMSr,�epsilon�eps�epsneg�xmax�huge�xmin�tiny�ibeta�__dict__�update�intr�	precision�
resolution�_str_eps�_str_epsneg�	_str_xmin�	_str_xmax�_str_resolution)
�selfr!r1r2r4r6r7�kwargs�float_to_float�float_to_strr)r$r!r*r�__init__#s$

zMachArLike.__init__N)�__name__�
__module__�__qualname__�__doc__rFrrrrr srz(numpy {} precision floating point numberz%24.16e�double)r-r'r,z%15.7e�singlez%szlong doublez%12.5e�halfcCs|t|<dSr)�_KNOWN_TYPES)�machar�bytepatrrr�_register_typeZsrQcCs�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�n1s�wYt|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�n	1�swYt|d.d-d$d)d/d+dddt|d.��|
||d�}t|d0�|td1<ttd2��r7t�
|t�|d��n|j}t|d3d4ddd5ddddt|d3��t|d4��|t|d��d�}t|d6�t|d7�|td8<dS)9Ni����i����i��r.��ri�g?)
�machep�negep�minexp�maxexp�it�iexpr7�irnd�ngrdr1r2r4r6sf�i��i��i�������g��?s��̽� g�<gi���i���i���i�4�g�<g�?�s���������@i����i����ignore)�allri����i@�p�s����������������i����i�����?s
����������P�	nextafteri����i�����is������Y<��������s��������������Y<�dd)�ntypes�float16rrrQ�	_float_ma�float32�float64�
longdoubler�errstate�hasattrr
rkr
r4)�f16�
float16_ma�f32�
float32_ma�f64�
epsneg_f64�tiny_f64�
float64_ma�ld�epsneg_f128�	tiny_f128�	huge_f128�float128_ma�
epsneg_f80�tiny_f80�huge_f80�
float80_ma�huge_dd�float_dd_marrr�_register_known_types^s

�



�
�
�
����
�
��


���r�cCs�t�|�}|durtt|���|d��d���}d}|tjkr(t�|dd��}|dur1t�|�}|dur7|St	j
d�||�tdd�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.zVSignature {} for {} does not match any known type: falling back to type probe functionrT)�
stacklevel)r/�get�
ValueError�repr�newbyteorder�tobytesrnrsrN�warnings�warn�format�UserWarning�_discovered_machar)r!r*�key�ma_likerrr�_get_machar�s"


�r�cs>t��t�fdd��fdd��fdd���fdd��d�S)zB Create MachAr instance with found information on float types
    crrrrr rrr" r#z$_discovered_machar.<locals>.<lambda>cst|��d��dS)Nr-r)r�astyper)r*rrr"!scstt|�d��S)Nrr(rr rrr""scr%r&r(rr)rrr"#r+r,)r/rr rr)rr�s

�r��numpyc@s4eZdZdZiZdd�Zdd�Zdd�Zdd	�Zd
S)ra�
    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.
    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
        The smallest positive floating point number with full precision
        (see Notes).

    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 ``tiny`` 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 ``tiny``. 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�|�}Wntyt�t|��}Ynw|j�|d�}|dur%|S|g}t�|�}||ur8|�|�|}t|tj	�sDt
d|��|j�|d�}|durQ|St|tj�sft|}||urf|�|�|}|j�|d�}|durs|St
�|��|�}|D]}||j|<q}|S)Nzdata type %r not inexact)r�dtype�	TypeError�type�_finfo_cacher��
obj2sctype�append�
issubclass�inexactr��floating�_convert_to_float�object�__new__�_init)�clsr��obj�dtypes�newdtype�dtrrrr�~s<�


z
finfo.__new__cCs�t�|�|_t|�}dD]}t||t||��qdD]}t||t||�jd�q|jjd|_|jjd|_	|j	|_
|jjd|_|j|_
|j|_||_|j��|_|j��|_|j��|_|j��|_|j��|_|S)N)r;rZrXrWrVrU)r6r<r2rr_)rr�r��setattr�getattr�flat�itemsize�bitsr4�max�minr1rZ�nexprY�nmantrOr?�strip�	_str_tinyr@�_str_maxr>r=rA)rBr�rO�wordrrrr��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
---------------------------------------------------------------
)r8�rBr'rrr�__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__rGr8r)rB�c�drrr�__repr__�s
�zfinfo.__repr__N)	rGrHrIrJr�r�r�r�r�rrrrr'sS!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�|�|_Wntyt�t|��|_Ynw|jj|_|jjd|_d|j|jf|_|jdvr<td|jf��dS)Nr_z%s%d�iuzInvalid integer data type %r.)	rr�r�r��kindr�r�r�r�)rB�int_typerrrrFs�

�ziinfo.__init__cCsV|jdkrdSz	tj|j}W|Sty*td|jd>�}|tj|j<Y|Sw)zMinimum value of given dtype.�urr)r�r�	_min_valsr��KeyErrorr:r��rB�valrrrr�
s
��z	iinfo.mincCshz	tj|j}W|Sty3|jdkrtd|j>d�}ntd|jd>d�}|tj|j<Y|Sw)zMaximum value of given dtype.r�r)r�	_max_valsr�r�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
---------------------------------------------------------------
�r�r�r�r�r�rrrr�'s�z
iinfo.__str__cCsd|jj|j|j|jfS)Nz%s(min=%s, max=%s, dtype=%s))r�rGr�r�r�)rBrrrr�2s�ziinfo.__repr__N)rGrHrIrJr�r�rF�propertyr�r�r�r�rrrrr�s0

)-rJ�__all__r�rOr�	overridesr�rrrnr	r
r
rrrrr�csinglerL�complex_�float_�
clongfloat�	longfloatr��
_title_fmtrK�dict�int64r��int32rs�longlongrM�int16r/rNrQrpr�r�r�rrrrrr�<module>sf������/&