
    Kh f                        S r SS/rSSKrSSKrSSKJr  SSKJr  SS	KJ	r	  SS
KJ
r  SSK	JrJrJr  SSKJrJrJrJr  S rS r " S S5      r\R.                  \R0                  \R2                  \R4                  \R6                  \R8                  0rSr\R>                  \ " \RB                  S\RE                  S5      S9\R0                  \ " \RF                  S\RE                  S5      S9\R8                  \ " \RH                  S\RE                  S5      S9\RJ                  \ " \RL                  S\RE                  S5      S90r'0 r(S r)0 r*S r+S r,S r-\" S5       " S  S5      5       r.\" S5       " S! S5      5       r/g)"zJMachine limits for Float32 and Float64 and (long double) if available...

finfoiinfo    N   )
set_module   )MachAr)numeric)numerictypes)arrayinfnan)log10exp2	nextafterisnanc                 T    U R                   S:X  a  U R                  5       n SU l        U $ )zfix rank-0 --> rank-1r   )r   )ndimcopyshapeas    G/var/www/html/env/lib/python3.13/site-packages/numpy/_core/getlimits.py_fr0r      s$    vv{FFHH    c                 T    U R                   S:X  a  U R                  5       n SU l        U $ )zfix rank > 0 --> rank-0r    )sizer   r   r   s    r   _fr1r      s$    vv{FFHHr   c                   X    \ rS rSrSrSS.S jr\S 5       r\S 5       rS r	S	 r
S
 rSrg)
MachArLike!   z#Object to simulate MachAr instance N)smallest_subnormalc                ~   [         U   U l        Xl        U R                  S   U l        U(       d9  [	        U R                  S5      U R                  S5      U R                  S9U l        OXpl        U R                  U5      =U l        U l        U R                  U5      U l	        U R                  U5      =U l
        U l        U R                  U5      U l        U R                  U5      =U l        U l        U R                  S   " U5      U l        U R                   R#                  U5        [%        ['        U R                  5      * 5      U l        U R                  U R+                  S5      U R(                  * -  5      U l        U R/                  U R                  5      U l        U R/                  U R                  5      U l        U R/                  U R                  5      U l        U R/                  U R                  5      U l        U R/                  U R,                  5      U l        U R/                  U R                  5      U l        g )Ntitler   r   dtypeitype
   )_MACHAR_PARAMSparamsftyper$   r   _smallest_subnormal_float_to_floatepsilonepsepsnegxmaxhugexmin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/   r0   r2   r5   r6   r"   kwargss	            r   __init__MachArLike.__init__#   s   $U+
[[)
!'0

1tzz!}DJJ(@D$ (:$"&"6"6s";;tx**62 $ 4 4T ::	DI((.	+/+?+?+EEty[[)%0
V$eDHHo-...R dnn_57**4884--dkk:++DII6++DII6#11$//B$($6$6tyy$A!r   c                     U R                   nU R                  S5      U:X  a3  [        R                  " SR	                  U R                  5      [
        SS9  U R                  U5      $ )zReturn 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.
r   z8The value of the smallest subnormal for {} type is zero.r   
stacklevel)r,   r+   warningswarnformatUserWarningr-   rD   values     r   r"   MachArLike.smallest_subnormal?   sV      ((::a=E!MM!6$**-{qJ ##E**r   c                 8    U R                  U R                  5      $ )z;Return the string representation of the smallest subnormal.)r=   r"   rD   s    r   _str_smallest_subnormal"MachArLike._str_smallest_subnormalW   s     !!$"9"9::r   c                 6    [        U R                  U5      5      $ )zYConverts float to float.

Parameters
----------
value : float
    value to be converted.
)r   r;   rO   s     r   r-   MachArLike._float_to_float\   s     D$$U+,,r   c                 0    [        U/U R                  5      $ )zXConverts float to conv.

Parameters
----------
value : float
    value to be converted.
)r   r+   rO   s     r   r;   MachArLike._float_convf   s     eWdjj))r   c                 f    U R                   S   [        [        U5      S   U R                  5      -  $ )zWConverts float to str.

Parameters
----------
value : float
    value to be converted.
fmtr   )r*   r   r   r+   rO   s     r   r=   MachArLike._float_to_strp   s+     {{5!E$u+a.$**$EEEr   )r,   r>   r?   rB   rC   rA   r@   r/   r.   r0   r+   r2   r6   r*   r:   r<   r4   r5   r$   r1   r3   )__name__
__module____qualname____firstlineno____doc__rF   propertyr"   rT   r-   r;   r=   __static_attributes__r   r   r   r    r    !   sF    .+/B8 + +. ; ;-*Fr   r    z(numpy {} precision floating point numberz%24.16edouble)r'   r[   r$   z%15.7esinglez%szlong doublez%12.5ehalfc                     U [         U'   g N)_KNOWN_TYPES)macharbytepats     r   _register_typerl      s    "Lr   c                  
   [         R                  n [        U SSSSSSSSS[        U " S5      5      [        U " S5      5      U " S	5      U " S
5      S9n[	        US5        U[
        S'   [         R                  n[        USSSSSSSSS[        U" S5      5      [        U" S5      5      U" SSS-  -  5      [        U" S5      5      S9n[	        US5        U[
        S'   [         R                  nSnSn[        USSSSSSSSSSUSU-
  U-  U" S 5      -  US9n[	        US!5        U[
        S"'   [         R                  n[        U" S#5      5      n	[        U" S$5      5      n
[        R                  " S%S&9   U" S'5      U	-
  U
-  U" S 5      -  nS S S 5        [        US(S#S$S)S*S+SSS[        U" S(5      5      U	WU
S9n[	        US,5        U[
        S'   [        U" S-5      5      n[        U" S$5      5      n[        R                  " S%S&9   U" S'5      U-
  U-  U" S 5      -  nS S S 5        [        US.S-S$S)S/S+SSS[        U" S.5      5      UWUS9n[	        US05        U[
        S1'   [        U" [        5      U" S5      US29n[        nU" [        S3S5      5      n[        US4S5SSS6SSSS[        U" S45      5      [        U" S55      5      UUUS79n[	        US85        [	        US95        U[
        S:'   g ! , (       d  f       GNc= f! , (       d  f       N= f);Niii   r(      r   r   i  g      ?)machepnegepminexpmaxexpitiexpr6   irndngrdr/   r0   r2   r5   s   fiii         g   ?s   ̽    g      <g       iiii   4      g      <g      ?   s   @   iiignore)allr   ii @  p      s   ii?   s
   P   r%   g        iii   )rp   rq   rr   rs   rt   ru   r6   rv   rw   r/   r0   r2   r5   r"   s   Y<s   Y<dd)ntypesfloat16r    r   rl   	_float_mafloat32float64
longdoubler	   errstater   r   r   )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smallest_normal_ddsmallest_subnormal_ddfloat_dd_mas                        r   _register_known_typesr      sU    ..CC#&"%#&#%!!""#!"!" $SX#'C>!$U!$X0J :x(IbM ..CC#&"%#'#&!!""#!"!" $SX#'C>!$laf%<!=!%c$i2J :23IbM ..CJHC#&"%#(#'!!#"#!"!" ,#-"%
"2h!>Q!G!)+J :BCIbM 
		Br$x.KRZ I			h	'U[(I51=	 
(R$(#'$*$) #"$#$"#"#!%bh$/"+"+-K ;KM IcN bgJBvJH			h	'qEJ&(2RU: 
(B#&"%#)#(!!#"#!"!" $RW#-!)!)+J :JKIbM 3Ab1G yR01R$(#'$)$( #"$#$"#"#!%bh$(DN")"40EGK  ;EG ;EG!IdOY 
(	'2 
(	's   .K">K4"
K14
Lc                    [         R                  U 5      nUc  [        [        U 5      5      eU " S5      U " S5      -  nUR	                  UR
                  R                  S5      5      R                  5       nSnU [        R                  :X  a  [        R                  USS 5      nUc  [        R                  U5      nUc`  [        U5      S:X  aQ  [        R                  5        VVs0 s H  u  pE[        U5      S:X  d  M  USS U_M     nnnUR                  USS 5      nUb  U$ [        R                  " SU SU  S	3[        S
S9  [!        U 5      $ s  snnf )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.
Ng      g      $@<r(   rn   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   rI   )r)   get
ValueErrorreprviewr&   newbyteordertobytesr   r   ri   lenitemsrK   rL   rN   _discovered_machar)r+   r*   keyma_likekv_kts          r   _get_macharr   8  sH   . &F~e%% ;s#C
((399))#.
/
7
7
9CG!!!
 ""3s8,""3'3s8r> &2%7%7%9J%9TQSVr\yq"vqy%9J''#cr(#MM
SEug &@ 	@ 		#
 e$$ Ks   %E>
Ec                 ^   ^ ^ [         T    m[        U 4S jU4S jU 4S jU U4S jTS   5      $ )zCreate MachAr instance with found information on float types

TODO: MachAr should be retired completely ideally.  We currently only
      ever use it system with broken longdouble (valgrind, WSL).
c                    > [        U /T5      $ rh   )r   r   r+   s    r   <lambda>$_discovered_machar.<locals>.<lambda>y  s    E1#u-r   c                 D   > [        U R                  TS   5      5      S   $ )Nr'   r   )r   astype)r   r*   s    r   r   r   z  s    D&/!:;A>r   c                 4   > [        [        U 5      S   T5      $ )Nr   r   r   r   s    r   r   r   {  s    E$q'!*e4r   c                 @   > TS   [        [        U 5      S   T5      -  $ )Nr[   r   r   )r   r+   r*   s    r   r   r   |  s    F5ME$q'!*e,DDr   r$   )r)   r   )r+   r*   s   `@r   r   r   r  s/     E"F->4D/	# #r   numpyc                   x    \ rS rSrSr0 r\" \R                  5      r	S r
S rS rS r\S 5       r\S 5       rS	rg
)r   i  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.
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 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]_.

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                     U R                   R                  U5      nUb  U$  Uc  [        R                  " S[
        SS9   [        R                  " U5      nU R                   R                  U5      nUb  U$ U/n[        R                  " U5      nXALa  UR                  U5        Un[        U[        R                  5      (       d  [        SU-  5      eU R                   R                  U5      nUb  U$ [        U[        R                  5      (       dX  [         U   nXALaK  UR                  U5        UnU R                   R                  US 5      nUb  U H  nX R                   U'   M     U$ ["        R%                  U 5      R'                  U5      nU H  nX R                   U'   M     U$ ! [         a     GNf = f! [         a#    [        R                  " [        U5      5      n GNf = f)Nzifinfo() dtype cannot be None. This behavior will raise an error in the future. (Deprecated in NumPy 1.25)r   rI   zdata type %r not inexact)_finfo_cacher   	TypeErrorrK   rL   DeprecationWarningr	   r&   typer   
obj2sctypeappend
issubclassinexactr   floating_convert_to_floatobject__new___init)clsr&   objdtypesnewdtypedts         r   r   finfo.__new__  s   	""&&u-C
 
 =MMK"		/MM%(E
 ""5)?J$$U+ MM(#E%1175ABB""5)?J%!1!122(/H$h' &&**5$7? %/2((, %JnnS!''.B#&R  
c  		  	/MM$u+.E	/s#   F( F9 (
F65F69)G&%G&c           	         [         R                  " U5      U l        [        U5      nS H  n[        X[	        X#5      5        M     S H%  n[        X[	        X#5      R
                  S   5        M'     U R                  R                  S-  U l        UR                  R
                  S   U l	        U R                  * U l
        UR                  R
                  S   U l        UR                  U l        UR                  U l        X l        UR"                  R%                  5       U l        UR(                  R%                  5       U l        UR,                  R%                  5       U l        UR.                  R%                  5       U l        UR0                  R%                  5       U l        UR2                  R%                  5       U l        UR4                  R%                  5       U l        U $ )N)r:   ru   rs   rr   rq   rp   )r<   r0   r"   r   rz   )r	   r&   r   setattrgetattrflatitemsizebitsr2   maxminr/   ru   nexprt   nmant_macharr@   strip	_str_tinyrA   _str_maxr?   r>   rB   rC   rT   )rD   r&   rj   words       r   r   finfo._init%  sj   ]]5)
U#D D 56 CDD 5 : :1 => CJJ''!+	;;##A&HH9::??1%KK	YY
))//1((..0!--335--/%55;;=$*$?$?$E$E$G!'-'E'E'K'K'M$r   c                 "    SnXR                   -  $ )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
---------------------------------------------------------------
)r7   rD   r[   s     r   __str__finfo.__str__?  s    
P 	 ]]""r   c                 t    U R                   R                  nU R                  R                  5       nXS'   SU-  $ )NklasszZ%(klass)s(resolution=%(resolution)s, min=-%(_str_max)s, max=%(_str_max)s, dtype=%(dtype)s))	__class__r]   r7   r   )rD   cds      r   __repr__finfo.__repr__O  s<    NN##MM '
7:;< 	=r   c                     [        U R                  R                  R                  S   5      (       a  [        R
                  " S[        SS9  U R                  R                  R                  S   $ )zReturn 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.
r   z;The value of smallest normal is undefined for double doubler   rI   )r   r   r4   r   rK   rL   rN   rS   s    r   r4   finfo.smallest_normalV  sU    " --221566MMM+ ||++0033r   c                     U R                   $ )a  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.
)r4   rS   s    r   r5   
finfo.tinym  s     ###r   )r   r>   r?   r   rB   rC   rT   r   r   r&   r/   r   r   r   r   N)r]   r^   r_   r`   ra   r   classmethodtypesGenericAlias__class_getitem__r   r   r   r   rb   r4   r5   rc   r   r   r   r   r     s^    eN L#E$6$676p4# = 4 4, $ $r   c                   v    \ rS rSrSr0 r0 r\" \R                  5      r
S r\S 5       r\S 5       rS rS rSrg	)
r   i  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                     [         R                  " U5      U l        U R                  R                  U l        U R                  R
                  S-  U l        SU R                  U R                  4-  U l        U R                  S;  a  [        SU R                  < S35      eg ! [         a'    [         R                  " [        U5      5      U l         Nf = f)Nrz   z%s%diuzInvalid integer data type .)	r	   r&   r   r   kindr   r   r   r   )rD   int_types     r   rF   iinfo.__init__  s    	7 x0DJ JJOO	JJ''!+	TYY		2299D 		KLL !  	7 tH~6DJ	7s   B! !.CCc                     U R                   S:X  a  g [        R                  U R                     nU$ ! [         a=    [        SU R                  S-
  -  * 5      nU[        R                  U R                  '    U$ f = f)zMinimum value of given dtype.ur   r   )r   r   	_min_valsr   KeyErrorr9   r   rD   vals     r   r   	iinfo.min  ss     990oodhh/ J  0A$))A+./0,/)J0s   2 AA98A9c                 2    [         R                  U R                     nU$ ! [         ak    U R                  S:X  a  [        SU R                  -  S-
  5      nO[        SU R                  S-
  -  S-
  5      nU[         R                  U R                  '    U$ f = f)zMaximum value of given dtype.r  r   )r   	_max_valsr   r  r   r9   r   r  s     r   r   	iinfo.max  s    	,//$((+C 
  	,yyC1		>Q./11-23(+EOODHH%
	,s   ! A1BBc                 R    SnXR                   U R                  U R                  S.-  $ )zString representation.zMachine parameters for %(dtype)s
---------------------------------------------------------------
min = %(min)s
max = %(max)s
---------------------------------------------------------------
r&   r   r   r  r   s     r   r   iinfo.__str__  s+    P 	 zz$((488LLLr   c                     U R                   R                  < SU R                  < SU R                  < SU R                  < S3$ )Nz(min=z, max=z, dtype=))r   r]   r   r   r&   rS   s    r   r   iinfo.__repr__  s.    151H1H$(HHdhh

D 	Dr   )r   r&   r   r   N)r]   r^   r_   r`   ra   r  r  r   r   r   r   rF   rb   r   r   r   r   rc   r   r   r   r   r     s_    1f II#E$6$67	M 
 
 
 
	MDr   )0ra   __all__r   rK   _utilsr   r   r    r	   r
   r   r   r   r   umathr   r   r   r   r   r   r    csinglere   
complex128r   clongdoubler   r   
_title_fmtrd   dictint64rM   int32longlongrf   int16r)   ri   rl   r   r   r   r   r   r   r   r   r   <module>r     s   G
      $ $ $ 0 0WF WFv NNFMM
v~~
))  8

MM4!!(+- MM4!!(+- t!!-02 KK!!&)+,8 # 	N"b7%t# G{$ {$ {$| GkD kD kDr   