~ubuntu-branches/ubuntu/precise/python-numpy/precise

« back to all changes in this revision

Viewing changes to numpy/core/getlimits.py

  • Committer: Package Import Robot
  • Author(s): Julian Taylor
  • Date: 2012-02-11 12:55:21 UTC
  • mfrom: (7.1.9 experimental) (7.2.3 sid)
  • Revision ID: package-import@ubuntu.com-20120211125521-31q3am7pp3mvt1ho
Tags: 1:1.6.1-5ubuntu1
* debian/patches/search-multiarch-paths.patch: (LP: #818867)
  - add multiarch libdirs to numpy.distutils.system_info
* Merge from Debian unstable, remaining changes:
  - debian/patches/20_disable-plot-extension.patch
     Disable plot_directive extension, and catch ImportErrors when
     matplotlib cannot be imported, which allows us to remove
     python-matplotlib from dependencies.  This is required because
     python-numpy is in main, while python-matplotlib is in universe.
  - Build using dh_python2
    add bin/f2py* to .install files
  - keep Replaces: python-numpy (<< 1:1.3.0-4) in python-numpy-dbg
    for lucid upgrades

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
    Attributes
29
29
    ----------
30
 
    eps : floating point number of the appropriate type
31
 
        The smallest representable number such that ``1.0 + eps != 1.0``.
 
30
    eps : float
 
31
        The smallest representable positive number such that
 
32
        ``1.0 + eps != 1.0``.  Type of `eps` is an appropriate floating
 
33
        point type.
32
34
    epsneg : floating point number of the appropriate type
33
 
        The smallest representable number such that ``1.0 - epsneg != 1.0``.
 
35
        The smallest representable positive number such that
 
36
        ``1.0 - epsneg != 1.0``.
34
37
    iexp : int
35
38
        The number of bits in the exponent portion of the floating point
36
39
        representation.
37
40
    machar : MachAr
38
 
        The object which calculated these parameters and holds more detailed
39
 
        information.
 
41
        The object which calculated these parameters and holds more
 
42
        detailed information.
40
43
    machep : int
41
 
        The exponent that yields ``eps``.
 
44
        The exponent that yields `eps`.
42
45
    max : floating point number of the appropriate type
43
46
        The largest representable number.
44
47
    maxexp : int
46
49
    min : floating point number of the appropriate type
47
50
        The smallest representable number, typically ``-max``.
48
51
    minexp : int
49
 
        The most negative power of the base (2) consistent with there being
50
 
        no leading 0's in the mantissa.
 
52
        The most negative power of the base (2) consistent with there
 
53
        being no leading 0's in the mantissa.
51
54
    negep : int
52
 
        The exponent that yields ``epsneg``.
 
55
        The exponent that yields `epsneg`.
53
56
    nexp : int
54
57
        The number of bits in the exponent including its sign and bias.
55
58
    nmant : int
56
59
        The number of bits in the mantissa.
57
60
    precision : int
58
 
        The approximate number of decimal digits to which this kind of float
59
 
        is precise.
 
61
        The approximate number of decimal digits to which this kind of
 
62
        float is precise.
60
63
    resolution : floating point number of the appropriate type
61
 
        The approximate decimal resolution of this type, i.e.
 
64
        The approximate decimal resolution of this type, i.e.,
62
65
        ``10**-precision``.
63
 
    tiny : floating point number of the appropriate type
64
 
        The smallest-magnitude usable number.
 
66
    tiny : float
 
67
        The smallest positive usable number.  Type of `tiny` is an
 
68
        appropriate floating point type.
65
69
 
66
70
    Parameters
67
71
    ----------
68
 
    dtype : floating point type, dtype, or instance
69
 
        The kind of floating point data type to get information about.
 
72
    dtype : float, dtype, or instance
 
73
        Kind of floating point data-type about which to get information.
70
74
 
71
75
    See Also
72
76
    --------
75
79
 
76
80
    Notes
77
81
    -----
78
 
    For developers of NumPy: do not instantiate this at the module level. The
79
 
    initial calculation of these parameters is expensive and negatively impacts
80
 
    import times. These objects are cached, so calling ``finfo()`` repeatedly
81
 
    inside your functions is not a problem.
 
82
    For developers of NumPy: do not instantiate this at the module level.
 
83
    The initial calculation of these parameters is expensive and negatively
 
84
    impacts import times.  These objects are cached, so calling ``finfo()``
 
85
    repeatedly inside your functions is not a problem.
82
86
 
83
87
    """
84
88
 
131
135
            itype = ntypes.longlong
132
136
            fmt = '%s'
133
137
            precname = 'long double'
 
138
        elif dtype is ntypes.half:
 
139
            itype = ntypes.int16
 
140
            fmt = '%12.5e'
 
141
            precname = 'half'
134
142
        else:
135
143
            raise ValueError, repr(dtype)
136
144