+
    ei1-  c                   sh    R t R.t^RIHt ^RIHt  ! R R4      t]R8X  d   ]! ]! 4       4       R# R# )z
Machine arithmetic - determine the parameters of the
floating-point arithmetic system

Author: Pearu Peterson, September 2003

MachAr)errstate)anyc                   sF   a  ] tR t^t o Rt]]]R R3R ltR tR t	Rt
V tR# )	r    a;  
Diagnosing machine parameters.

Attributes
----------
ibeta : int
    Radix in which numbers are represented.
it : int
    Number of base-`ibeta` digits in the floating point mantissa M.
machep : int
    Exponent of the smallest (most negative) power of `ibeta` that,
    added to 1.0, gives something different from 1.0
eps : float
    Floating-point number ``beta**machep`` (floating point precision)
negep : int
    Exponent of the smallest power of `ibeta` that, subtracted
    from 1.0, gives something different from 1.0.
epsneg : float
    Floating-point number ``beta**negep``.
iexp : int
    Number of bits in the exponent (including its sign and bias).
minexp : int
    Smallest (most negative) power of `ibeta` consistent with there
    being no leading zeros in the mantissa.
xmin : float
    Floating-point number ``beta**minexp`` (the smallest [in
    magnitude] positive floating point number with full precision).
maxexp : int
    Smallest (positive) power of `ibeta` that causes overflow.
xmax : float
    ``(1-epsneg) * beta**maxexp`` (the largest [in magnitude]
    usable floating value).
irnd : int
    In ``range(6)``, information on what kind of rounding is done
    in addition, and on how underflow is handled.
ngrd : int
    Number of 'guard digits' used when truncating the product
    of two mantissas to fit the representation.
epsilon : float
    Same as `eps`.
tiny : float
    An alias for `smallest_normal`, kept for backwards compatibility.
huge : float
    Same as `xmax`.
precision : float
    ``- int(-log10(eps))``
resolution : float
    ``- 10**(-precision)``
smallest_normal : float
    The smallest positive floating point number with 1 as leading bit in
    the mantissa following IEEE-754. Same as `xmin`.
smallest_subnormal : float
    The smallest positive floating point number with 0 as leading bit in
    the mantissa following IEEE-754.

Parameters
----------
float_conv : function, optional
    Function that converts an integer or integer array to a float
    or float array. Default is `float`.
int_conv : function, optional
    Function that converts a float or float array to an integer or
    integer array. Default is `int`.
float_to_float : function, optional
    Function that converts a float array to float. Default is `float`.
    Note that this does not seem to do anything useful in the current
    implementation.
float_to_str : function, optional
    Function that converts a single float to a string. Default is
    ``lambda v:'%24.16e' %v``.
title : str, optional
    Title that is printed in the string representation of `MachAr`.

See Also
--------
finfo : Machine limits for floating point types.
iinfo : Machine limits for integer types.

References
----------
.. [1] Press, Teukolsky, Vetterling and Flannery,
       "Numerical Recipes in C++," 2nd ed,
       Cambridge University Press, 2002, p. 31.

c                s
    V R  # )z24.16e )Zvs   &:/usr/lib64/python3.14/site-packages/numpy/_core/_machar.pyZ<lambda>ZMachAr.<lambda>i   s
    1V*    zPython floating point numberc           	     s    \        RR7      ;_uu_ 4        V P                  WW4V4       RRR4       R#   + '       g   i     R# ; i)z

float_conv - convert integer to float (array)
int_conv   - convert float (array) to integer
float_to_float - convert float array to float
float_to_str - convert array float to str
title        - description of used floating point numbers

Zignore)ZunderN)r   _do_init)self
float_convint_convfloat_to_floatfloat_to_strtitles   &&&&&&r   __init__ZMachAr.__init__g   s.     H%%MM*eT &%%%s	   3A	c                s   R pRpV! ^4      pW,           p	W,
          p
Tp\        V4       F7  pW,           pW,           pW,
          p\        W,
          V
8g  4      '       g   K7   M 	  \        VXVP                  3,          4      hTp\        V4       F7  pW,           pW,           pV! W,
          4      p\        V^ 8g  4      '       g   K7   M	  \        W|VP                  3,          4      hTpV! V4      pRpTp\        V4       FA  pV^,           pVV,          pW,           pW,
          p\        W,
          V
8g  4      '       g   KA   M	  \        W|VP                  3,          4      hVV	,          pTp\        V4       F7  pW,           pW,           pW,
          p\        W,
          V
8g  4      '       g   K7   M	  \        W|VP                  3,          4      hVV,           p^ p\        W,
          V
8g  4      '       d   ^pVV,           pVV,           pV^ 8X  d   \        VV,
          V
8g  4      '       d   ^pV^,           pVV,          pTp\        V4       F  pVV,          pK  	  Tp\        V4       FZ  pW,
          p\        W,
          V
8g  4      '       d    MTVV,          pV^,
          pV^ 8  g   KB  \        R\	        4       ,          4      h	  \        W|VP                  3,          4      hV) pTpV) ^,
          pTp\        V4       F9  pW,           p\        W,
          V
8g  4      '       d    M3VV,          pV^,           pK;  	  \        W|VP                  3,          4      hTp^ pVV,           pV^ 8X  d$   \        W,          V,
          V
8g  4      '       d   ^p^ p^pTpVV,           p ^ p!\        V4       F  pTp"V"V",          pVV,          pVV ,          p\        W,           V
8H  4      '       g   \        \        V4      V"8  4      '       d    MYVV,          p\        VV,          V8H  4      '       d    M3V^,           pVV,           pK  	  \        W|VP                  3,          4      hV^
8w  d   V^,           p#VV,           p$M/^p#Tp%VV%8  d   V%V,          p%V#^,           p#K  V%V%,           ^,
          p$\        V4       F  pT"p&V"V,          p"V"V,          pV"V ,          p\        W,           V
8g  4      '       di   \        \        V"4      V&8  4      '       dL   V^,           pVV,          p\        VV,          V"8H  4      '       d   \        VV"8g  4      '       d   ^p!T"p& M%K  K   M	  \        W|VP                  3,          4      hV) p'V$VV,           ^,
          8:  d   V^
8w  d   V$V$,           p$V#^,           p#V$V',           p(VV!,           pV^8  d
   V(^,
          p(V(V',           pV^8X  d   V'       g
   V(^,
          p(V^8  d
   V(^,
          p(\        VV"8g  4      '       d
   V(^,
          p(VV,
          p)\        V)V,          V)8g  4      '       d   VVV,          ,
          p)V)V&V,          V,          V,          ,          p)V(V',           ^,           p\        V4       F  p*V^8X  d   V)V),           p)K  V)V,          p)K   	  \        V&VV,          ,          4      p+VV n        VV n        VV n        V! V4      V n	        V! V4      V n
        VV n        V! V4      V n        V! V4      V n        VV n        V#V n        V'V n        V! V&4      V n        V! V&4      V n        V(V n        V! V)4      V n        V! V)4      V n        VV n        WPn        V P                  V n        V P"                  V n        V P(                  V n        V P"                  V n        V! V P"                  4      V n        V! V+4      V n        V! V+4      V n        ^ RIp,\A        V,PC                  V! V P                  4      4      ) 4      V n"        W,           V	,           V	,           V	,           p-V-V PD                  ) ,          p.V! V.4      V n#        V! V.4      V n$        R# )i'  z'Did not converge after %d tries with %szAcould not determine machine tolerance for 'negep', locals() -> %sNi)%Zranger   ZRuntimeErrorZdtypeZlocalsZabsibetaitnegepepsneg_str_epsnegmachepeps_str_epsngrdiexpminexpxmin	_str_xminmaxexpxmax	_str_xmaxirndr   epsilontinyhugesmallest_normal_str_smallest_normalsmallest_subnormal_str_smallest_subnormalmathintZlog10	precision
resolution_str_resolution)/r   r   r	   r
   r   r   Z	max_iterNZmsgZoneZtwoZzeroZaZ_ZtempZtemp1ZbZitempr   Zbetar   Zbetahr   Ztempar   ZbetainZir   r   r   r   ZkZzZtZnxresZyr   ZmxZizr   r   r   r   Zjr$   r&   Ztenr)   s/   &&&&&&                                         r   r   ZMachAr._do_inity   s   	7miy y!AA7DHE5;$&'' " sa^344y!AA5DTX&E5A: " s^344%  y!AaBDA7DHE5;$&'' " s^344s
y!AA7DHE5;$&'' " s^3445ytx4  DDu}19TE\T122D QtuAF
A y!A7D4:%&&DAAIEqy" $ADJH$N O O " s^344 y!A7D4:%&&DAaZF " s^344 Sy19TZ#-566D #Iy!AAAACAq5D15D=!!SQ1%5%56ME54<1$%%AAAA " s^344B;q5DQBDBr'%Zaxb1B y!ADF
ACAq5DAEd?##CFTM(:(:Evut|q())c$!)nnED /=)
  " s^344 Q?u{bB!8Dfe|19aZFVOA:aaZFr6aZFqAv;;aZFV|tczT!""&Dtd{T)D01VOaqAzd{d{	  !!45

$V,'/!#&$S)		"4(	%d+"4(	%d+	
xxII	II	#yy$0$;!"01C"D'34F'G$djj)ABBCi#o#c)dnn_-
(4+J7r   c                s*    R pWP                   ,          # )aC  Machine parameters for %(title)s
---------------------------------------------------------------------
ibeta=%(ibeta)s it=%(it)s iexp=%(iexp)s ngrd=%(ngrd)s irnd=%(irnd)s
machep=%(machep)s     eps=%(_str_eps)s (beta**machep == epsilon)
negep =%(negep)s  epsneg=%(_str_epsneg)s (beta**epsneg)
minexp=%(minexp)s   xmin=%(_str_xmin)s (beta**minexp == tiny)
maxexp=%(maxexp)s    xmax=%(_str_xmax)s ((1-epsneg)*beta**maxexp == huge)
smallest_normal=%(smallest_normal)s    smallest_subnormal=%(smallest_subnormal)s
---------------------------------------------------------------------
)Z__dict__)r   Zfmts   & r   __str__ZMachAr.__str__R  s    	U 	 ]]""r   )r   r   r*   r#   r%   r   r   r   r   r   r!   r   r   r   r   r   r   r   r   r   r(   r)   r"   r$   r    r   r   r   N)__name__Z
__module__Z__qualname__Z__firstlineno____doc__Zfloatr'   r   r   r+   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r    r       s3     Tl #(# %55U$W8r# #r   Z__main__N)	r-   Z__all__Z_ufunc_configr   Zfromnumericr   r    r,   Zprintr   r   r   <module>r.      s>    * # 
O# O#d
 z	&(O r   