
    rbi:                     N   d Z ddgZddlZddlZddlZddlmZ ddlmZ ddl	m
Z
mZ dd	lmZ d
 Zd Zej        ej        ej        ej        ej        ej        iZdZej        ej        de                    d          dej        ej        de                    d          dej        ej        de                    d          dej        ej        de                    d          diZ  ed           G d d                      Z! ed           G d d                      Z"dS )zJMachine limits for Float32 and Float64 and (long double) if available...

finfoiinfo    N)cached_property)
set_module   )numericnumerictypes)_populate_finfo_constantsc                 R    | j         dk    r|                                 } d| _        | S )zfix rank-0 --> rank-1r   )r   )ndimcopyshapeas    e/var/www/html/mdtn/previsions/meteo_cartes/venv/lib/python3.11/site-packages/numpy/_core/getlimits.py_fr0r      s&    v{{FFHHH    c                 R    | j         dk    r|                                 } d| _        | S )zfix rank > 0 --> rank-0r    )sizer   r   r   s    r   _fr1r      s&    v{{FFHHHr   z(numpy {} precision floating point numberz%24.16edouble)itypefmttitlez%15.7esingle%szlong doublez%12.5ehalfnumpyc                       e Zd ZdZi Z eej                  Zd Z	d Z
ed             Zed             Zed             Zed             Zed             Zed	             Zd
 Zd Zed             ZdS )r   a  
    finfo(dtype)

    Machine limits for floating point types.

    Attributes
    ----------
    bits : int
        The number of bits occupied by the type.
    dtype : dtype
        Returns the dtype for which `finfo` returns information. For complex
        input, the returned dtype is the associated ``float*`` dtype for its
        real and complex components.
    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.
    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.
        Corresponds to the C standard MAX_EXP.
    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. Corresponds to the C
        standard MIN_EXP - 1.
    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 explicit bits in the mantissa (excluding the implicit
        leading bit for normalized numbers).
    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 or complex floating point
        data-type about which to get information.

    See Also
    --------
    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]_.

    For ``longdouble``, the representation varies across platforms. On most
    platforms it is IEEE 754 binary128 (quad precision) or binary64-extended
    (80-bit extended precision). On PowerPC systems, it may use the IBM
    double-double format (a pair of float64 values), which has special
    characteristics for precision and range.

    This function can also be used for complex data types as well. If used,
    the output will be the same as the corresponding real float type
    (e.g. numpy.finfo(numpy.csingle) is the same as numpy.finfo(numpy.single)).
    However, the output is true for the real and imaginary components.

    References
    ----------
    .. [1] IEEE Standard for Floating-Point Arithmetic, IEEE Std 754-2008,
           pp.1-70, 2008, https://doi.org/10.1109/IEEESTD.2008.4610935
    .. [2] Wikipedia, "Denormal Numbers",
           https://en.wikipedia.org/wiki/Denormal_number

    Examples
    --------
    >>> import numpy as np
    >>> np.finfo(np.float64).dtype
    dtype('float64')
    >>> np.finfo(np.complex64).dtype
    dtype('float32')

    c                    	 | j                             |          }||S n# t          $ r Y nw xY w|t          j        dt
          d           	 t          j        |          }n1# t          $ r$ t          j        t          |                    }Y nw xY w| j                             |          }||S |g}t          j
        |          }||ur|                    |           |}t          |t          j                  st          d|d          | j                             |          }||S t          |t          j                  sVt           |         }||urE|                    |           |}| j                             |d           }||D ]}|| j         |<   |S t"                              |                               |          }|D ]}|| j         |<   |S )Nzifinfo() dtype cannot be None. This behavior will raise an error in the future. (Deprecated in NumPy 1.25)   )
stacklevelz
data type z not inexact)_finfo_cacheget	TypeErrorwarningswarnDeprecationWarningr   dtypetypentypes
obj2sctypeappend
issubclassinexact
ValueErrorfloating_convert_to_floatobject__new___init)clsr*   objdtypesnewdtypedts         r   r5   zfinfo.__new__   s3   	"&&u--C
  	 	 	D	 =MK"	   	/M%((EE 	/ 	/ 	/M$u++..EEE	/ ""5))?J$U++5  MM(###E%11 	A?%???@@@""5))?J%!122 	(/Hu$$h''' &**5$77? % 3 3/2(,,JnnS!!''.. 	' 	'B#&CR  
s   ! 
..A% %+BBc                     t          j        |          | _        | j        j        dz  | _        d | _        d | _        t          | | j                   | S )N   )r   r*   itemsizebits_fmt_reprr
   )selfr*   s     r   r6   zfinfo._init   sI    ]5))
J'!+		
!$
333r   c                      | j         | j        z  S N)eps_radixrB   s    r   epsnegzfinfo.epsneg   s     x$+%%r   c                 H    | j                             d          | j         z  S )N
   )r*   r+   	precisionrG   s    r   
resolutionzfinfo.resolution   s    zr""T^O33r   c                 N    t          t          j        | j                            S rD   )intmathlog2rE   rG   s    r   machepzfinfo.machep   s    49TX&&'''r   c                 N    t          t          j        | j                            S rD   )rN   rO   rP   rH   rG   s    r   negepzfinfo.negep   s    49T[))***r   c                 n    t          j        t          j        | j        | j        z
  dz                       S )Nr"   rO   ceilrP   maxexpminexprG   s    r   nexpz
finfo.nexp  s,     y4;#<q#@AABBBr   c                 h    t          j        t          j        | j        | j        z
                      S rD   rU   rG   s    r   iexpz
finfo.iexp  s'     y4;#<==>>>r   c                     t           dd           x}|S d% fd	} |dd          } |dd          } |dd          } |dd          } |d	d          } |d
          } |d          }	 |d          }
 |d          } |d          } |d          } |dd          } |d          }t           d          r$t           d          r j          j        k    rd}n |d          }d                    g d j         d| d| d| d|	 d| d|
 d| d| d| d| d | d!| d"| d#| d$          }| _        |S )&Nr@   c                     t          | d           x}dS |"t          |                              |          }t          |          S )Nz<undefined>)getattrstrljust)namepadvalsrB   s       r   get_strzfinfo.__str__.<locals>.get_str  sF    tT40009$}HHNN3''s88Or   rK      rQ      rS   rX   rW   rL   rE   rH   tinysmallest_normalsmallest_subnormalrY   maxminz-max zMachine parameters for zM
---------------------------------------------------------------
precision = z   resolution = z

machep = z   eps =        z

negep =  z   epsneg =     z

minexp = z   tiny =       z

maxexp = z   max =        z

nexp =   z   min =        z
smallest_normal = z   smallest_subnormal = zA
---------------------------------------------------------------
rD   )r^   hasattrrl   rk   joinr*   r@   )rB   r   re   rK   rQ   rS   rX   rW   rL   rE   rH   rh   ri   rj   rY   max_min_s   `                r   __str__zfinfo.__str__  sC   4...C;J	 	 	 	 	 	 GK++	1%%##1%%1%%W\**
genn""wv!'"344$W%9::wvq!!wu~~4 	"GD%$8$8 	"dhY$(=R=RDD75>>D
Q 
Q 
Q 
Q 
Q 
Qdj 
Q 
Q 
Q 
Q$
Q 
Q 
Q 
Q6@
Q 
Q 
Q 
Q 
Q 
Q 
Q 
Q 14
Q 
Q 
Q 
Q 	
Q 
Q 
Q 
Q 06	
Q 
Q 
Q 
Q
 
Q 
Q 
Q 
Q
 15
Q 
Q 
Q 
Q 
Q 
Q 
Q 
Q 15
Q 
Q 
Q 
Q 
Q 
Q 
Q 
Q /3
Q 
Q 
Q 
Q "1
Q 
Q 
Q 
Q %7
Q 
Q 
Q 
Q 
Q 
Q 	 	
r   c           
      *   t          | dd           x}|S | j        j        }t                              | j        j        i                               dd          }|dk    rYt          | d          rIt          | d          r9|| j        z  	                                }|| j
        z  	                                }n(t          | j                  }t          | j
                  }t          | j                  }| d| d| d| d	| j         d

}|| _        |S )NrA   r   r   rk   rl   z(resolution=z, min=, max=, dtype=))r^   	__class____name___MACHAR_PARAMSr%   r*   r+   rn   rk   striprl   r_   rL   rA   )rB   repr_strcfmt_strmax_strmin_strresolution_strs          r   __repr__zfinfo.__repr__:  s'   gt444HAON# !$$TZ_b99==eTJJd??wtU33?e8L8L?)0022G)0022GG$(mmG$(mmGT_-- ; ;n ; ;G ; ;#; ;-1Z; ; ;
r   c                     | j         S )aQ  Return 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.
        )ri   rG   s    r   rh   z
finfo.tinyP  s     ##r   N)rx   
__module____qualname____doc__r$   classmethodtypesGenericAlias__class_getitem__r5   r6   r   rH   rL   rQ   rS   rY   r[   rr   r   rh   r   r   r   r   r   <   s9       n n` L#E$6776 6 6p   & & _& 4 4 _4 ( ( _( + + _+ C C _C ? ? _?+ + +Z  , $ $ _$ $ $r   c                   x    e Zd ZdZi Zi Z eej                  Z	d Z
ed             Zed             Zd Zd ZdS )r   a  
    iinfo(type)

    Machine limits for integer types.

    Attributes
    ----------
    bits : int
        The number of bits occupied by the type.
    dtype : dtype
        Returns the dtype for which `iinfo` returns information.
    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:

    >>> import numpy as np
    >>> 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

    c                 `   	 t          j        |          | _        n6# t          $ r) t          j        t          |                    | _        Y nw xY w| j        j        | _        | j        j        dz  | _        d| j        | j        fz  | _        | j        dvrt          d| j        d          d S )Nr=   z%s%diuzInvalid integer data type .)	r   r*   r&   r+   kindr>   r?   keyr1   )rB   int_types     r   __init__ziinfo.__init__  s    	7 x00DJJ 	7 	7 	7 tH~~66DJJJ	7JO	J'!+	TY	229D  H$)HHHIII ! s    0AAc                     | j         dk    rdS 	 t          j        | j                 }n?# t          $ r2 t          d| j        dz
  z             }|t          j        | j        <   Y nw xY w|S )zMinimum value of given dtype.ur   r   )r   r   	_min_valsr   KeyErrorrN   r?   rB   rc   s     r   rl   z	iinfo.min  s|     910odh/ 0 0 0A$)a-0122,/)))0 Js   ' 9A#"A#c                    	 t           j        | j                 }ng# t          $ rZ | j        dk    rt          d| j        z  dz
            }nt          d| j        dz
  z  dz
            }|t           j        | j        <   Y nw xY w|S )zMaximum value of given dtype.r   r   )r   	_max_valsr   r   r   rN   r?   r   s     r   rk   z	iinfo.max  s    	,/$(+CC 	, 	, 	,yC1	>Q.//1Q/1455(+EODH%%%	, 
s    A!A>=A>c                 6    d}|| j         | j        | j        dz  S )zString representation.zMachine parameters for %(dtype)s
---------------------------------------------------------------
min = %(min)s
max = %(max)s
---------------------------------------------------------------
r*   rl   rk   r   )rB   r   s     r   rr   ziinfo.__str__  s*    P 	 tz$(48LLLLr   c                 P    | j         j        d| j        d| j        d| j        dS )Nz(min=rt   ru   rv   )rw   rx   rl   rk   r*   rG   s    r   r   ziinfo.__repr__  s5    151H1H1H$(HHHdhhh


D 	Dr   N)rx   r   r   r   r   r   r   r   r   r   r   propertyrl   rk   rr   r   r   r   r   r   r   b  s        1 1f II#E$677	J 	J 	J 
 
 X
 
 
 X
	M 	M 	MD D D D Dr   )#r   __all__rO   r   r'   	functoolsr   numpy._utilsr   rm   r   r	   r,   _multiarray_umathr
   r   r   csingler   
complex128float64clongdouble
longdoubler3   
_title_fmtr   int64formatint32longlongr   int16ry   r   r   r   r   r   <module>r      s$    G
    % % % % % % # # # # # # - - - - - - - - 8 8 8 8 8 8     NFM
v~
)  8

M""8,,. . M""8,,. . ""=113 3 K""6**, ,-& Gb$ b$ b$ b$ b$ b$ b$ b$J	 GkD kD kD kD kD kD kD kD kD kDr   