ó É9Zc@`spdZddlmZmZmZddgZddlmZddlm Z ddlm Z dd l m Z d „Z ie je j6e je j6e je j6Zdefd „ƒYZdefd „ƒYZed krlee jƒZedejƒedejƒee jƒZedejƒedejƒee jƒZedejƒedejƒndS(sJMachine limits for Float32 and Float64 and (long double) if available... i(tdivisiontabsolute_importtprint_functiontfinfotiinfoi(tMachAr(tnumeric(t numerictypes(tarraycC`s|jdkrd|_n|S(sfix rank-0 --> rank-1ii(i(tndimtshape(ta((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt_frz s cB`s8eZdZiZd„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. cC`s…ytj|ƒ}Wn&tk r;tjt|ƒƒ}nX|jj|dƒ}|dk ra|S|g}tj|ƒ}||k r›|j|ƒ|}nt |tj ƒsÀt d|ƒ‚n|jj|dƒ}|dk rå|St |tj ƒs&t |}||k r&|j|ƒ|}q&n|jj|dƒ}|dk rK|Stj|ƒj|ƒ}x|D]}||j|”sc`st|jˆƒƒdS(Ni(R tastype(R%(titype(sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR&•sc`stt|ƒdˆƒS(Ni(RR (R%(R (sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR&–sc`sˆtt|ƒdˆƒS(Ni(RR (R%(R tfmt(sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyR&—ss(numpy %s precision floating point numbert precisiontiexptmaxexptminexptnegeptmachepttinyt resolutiontepsnegi("RR tntypesR"tint64R#tint32t longdoubletlonglongR$tint16RtreprRtsetattrtgetattrtflatthugetmaxtmintepsR+tnexptittnmanttmachart _str_xmintstript _str_tinyt _str_xmaxt_str_maxt _str_epsnegt_str_epst_str_resolution(tselfR tprecnameRDtword((R R)R(sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyRsR              $    cC`sd}||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__(RMR)((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt__str__­s cC`s-|jj}|jjƒ}||d>> 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 cC`sŸytj|ƒ|_Wn)tk rAtjt|ƒƒ|_nX|jj|_|jjd|_d|j|jf|_|jdkr›tdƒ‚ndS(Nis%s%dtiusInvalid integer data type.( RR RRtkindtitemsizetbitstkeyR(RMtint_type((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyt__init__õs cC`sk|jdkrdSytj|j}Wn9tk rbtd|jd> ƒ}|tj|jdƒ}ntd|jd>dƒ}|tj|js cC`s,d}|i|jd6|jd6|jd6S(sString representation.s½Machine parameters for %(dtype)s --------------------------------------------------------------- min = %(min)s max = %(max)s --------------------------------------------------------------- R R?R>(R R?R>(RMR)((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyRQscC`s#d|jj|j|j|jfS(Ns%s(min=%s, max=%s, dtype=%s)(RSRTR?R>R (RM((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyRX's ( RTRYRZRcRgRaR?tpropertyR>RQRX(((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyRÃs-   t__main__ssingle epsilon:s single tiny:sfloat epsilon:s float tiny:slongfloat epsilon:slongfloat tiny:N(RZt __future__RRRt__all__RDRtRRR3RR R#tcsingletfloat_tcomplex_t longfloatt clongfloatRRRRRTtftprintR@R0tfloat(((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/getlimits.pyts.    ªh