Current File : //usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyo
�
E�`Qc@s4dZddgZddlmZddlZddlZddlmZd�Ziej	ej
6ejej6ej
ej6Zdefd��YZdefd	��YZed
kr0eej	�ZdGejGHdGejGHeej�Zd
GejGHdGejGHeej
�ZdGejGHdGejGHndS(sJ Machine limits for Float32 and Float64 and (long double) if available...
tfinfotiinfoi����(tMachArN(tarraycCs|jdkrd|_n|S(sfix rank-0 --> rank-1ii(i(tndimtshape(ta((s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyt_frzscBs8eZdZiZd�Zd�Zd�Zd�ZRS(s.	
    finfo(dtype)

    Machine limits for floating point types.

    Attributes
    ----------
    eps : float
        The smallest representable positive number such that
        ``1.0 + eps != 1.0``.  Type of `eps` is an appropriate floating
        point type.
    epsneg : floating point number of the appropriate type
        The smallest representable positive number such that
        ``1.0 - epsneg != 1.0``.
    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 usable number.  Type of `tiny` is an
        appropriate floating point type.

    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.

    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.

    cCs�ytj|�}Wn&tk
r;tjt|��}nX|jj|d�}|dk	ra|S|g}tj|�}||k	r�|j|�|}nt	|tj
�s�td|��n|jj|d�}|dk	r�|St	|tj�s&t
|}||k	r&|j|�|}q&n|jj|d�}|dk	rK|Stj|�j|�}x|D]}||j|<qjW|S(Nsdata type %r not inexact(tnumerictdtypet	TypeErrorttypet_finfo_cachetgettNonet
obj2sctypetappendt
issubclasstinexactt
ValueErrortfloatingt_convert_to_floattobjectt__new__t_init(tclsR	tobjtdtypestnewdtypetdt((s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyR[s:
	
	


cs+tj��|_�tjkr9tj�d�d}n��tjkr`tj�d�d}n`�tjkr�tj�d�d}n9�tj	kr�tj
�d�d}ntt����t
�fd	��fd
��fd���fd�d
|�}x9ddddddgD]}t||t||��qWx7dddgD]&}t||t||�jd�qOW|jjd|_|j|_|jjd|_|j|_|j|_||_|jj�|_|jj�|_|jj�|_|j j�|_ |j!j�|_!|S(Ns%24.16etdoubles%15.7etsingles%sslong doubles%12.5ethalfcst|g��S(N(R(tv(R	(s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyt<lambda>�scst|j���dS(Ni(Rtastype(R!(titype(s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyR"�scstt|�d��S(Ni(RR(R!(R	(s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyR"�scs�tt|�d��S(Ni(RR(R!(R	tfmt(s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyR"�ss(numpy %s precision floating point numbert	precisiontiexptmaxexptminexptnegeptmachepttinyt
resolutiontepsnegi("RR	tntypesRtint64Rtint32t
longdoubletlonglongR tint16RtreprRtsetattrtgetattrtflatthugetmaxtmintepsR'tnexptittnmanttmachart	_str_xmintstript	_str_tinyt	_str_xmaxt_str_maxt_str_epsnegt_str_epst_str_resolution(tselfR	tprecnameR@tword((R	R%R$s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyR|sR								
		
$
	cCsd|jS(Ns�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
---------------------------------------------------------------------
(t__dict__(RI((s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyt__str__�scCs1|jj}|jj�}||d<dd|S(Ntklasss7%(klass)s(resolution=%(resolution)s, min=-%(_str_max)s,s# max=%(_str_max)s, dtype=%(dtype)s)(t	__class__t__name__RLtcopy(RItctd((s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyt__repr__�s
(RPt
__module__t__doc__RRRRMRT(((s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyRsA	!	.	
cBs_eZdZiZiZd�Zd�Zee�Zd�Zee�Zd�Z	d�Z
RS(s(
    iinfo(type)

    Machine limits for integer types.

    Attributes
    ----------
    min : int
        The smallest integer expressible by the type.
    max : int
        The largest integer expressible by the type.

    Parameters
    ----------
    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�ytj|�|_Wn)tk
rAtjt|��|_nX|jj|_|jjd|_d|j|jf|_|jdkr�td��ndS(Nis%s%dtiusInvalid integer data type.(	RR	R
RtkindtitemsizetbitstkeyR(RItint_type((s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyt__init__�s
cCsk|jdkrdSytj|j}Wn9tk
rbtd|jd>�}|tj|j<nX|SdS(sMinimum value of given dtype.tuiliN(RXRt	_min_valsR[tKeyErrortintRZ(RItval((s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyR;�s
cCs�ytj|j}Wnetk
r{|jdkrMtd|j>d�}ntd|jd>d�}|tj|j<nX|S(sMaximum value of given dtype.R^li(Rt	_max_valsR[R`RXRaRZ(RIRb((s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyR:s
cCs&di|jd6|jd6|jd6S(sString representation.s�Machine parameters for %(dtype)s
---------------------------------------------------------------------
min = %(min)s
max = %(max)s
---------------------------------------------------------------------
R	R;R:(R	R;R:(RI((s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyRMscCs#d|jj|j|j|jfS(Ns%s(min=%s, max=%s, dtype=%s)(RORPR;R:R	(RI((s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyRT#s(RPRURVR_RcR]R;tpropertyR:RMRT(((s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyR�s-				
t__main__ssingle epsilon:ssingle tiny:sfloat epsilon:sfloat tiny:slongfloat epsilon:slongfloat tiny:(RVt__all__R@RRtnumerictypesR/RRRtcsingletfloat_tcomplex_t	longfloatt
clongfloatRRRRRPtfR<R,tfloat(((s:/usr/lib64/python2.7/site-packages/numpy/core/getlimits.pyt<module>s,	

�g