class documentation

class MachAr: (source)

View In Hierarchy

Diagnosing machine parameters.

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.
Parameters
float_convFunction that converts an integer or integer array to a float or float array. Default is float.
int_convFunction that converts a float or float array to an integer or integer array. Default is int.
float_to_floatFunction 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_strFunction that converts a single float to a string. Default is lambda v:'%24.16e' %v.
titleTitle that is printed in the string representation of MachAr.
Method __init__ 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...
Method __str__ Undocumented
Instance Variable eps Floating-point number beta**machep (floating point precision)
Instance Variable epsilon Same as eps.
Instance Variable epsneg Floating-point number beta**negep.
Instance Variable huge Same as xmax.
Instance Variable ibeta Radix in which numbers are represented.
Instance Variable iexp Number of bits in the exponent (including its sign and bias).
Instance Variable irnd In range(6), information on what kind of rounding is done in addition, and on how underflow is handled.
Instance Variable it Number of base-ibeta digits in the floating point mantissa M.
Instance Variable machep Exponent of the smallest (most negative) power of ibeta that, added to 1.0, gives something different from 1.0
Instance Variable maxexp Smallest (positive) power of ibeta that causes overflow.
Instance Variable minexp Smallest (most negative) power of ibeta consistent with there being no leading zeros in the mantissa.
Instance Variable negep Exponent of the smallest power of ibeta that, subtracted from 1.0, gives something different from 1.0.
Instance Variable ngrd Number of 'guard digits' used when truncating the product of two mantissas to fit the representation.
Instance Variable precision - int(-log10(eps))
Instance Variable resolution - 10**(-precision)
Instance Variable smallest_normal The smallest positive floating point number with 1 as leading bit in the mantissa following IEEE-754. Same as xmin.
Instance Variable smallest_subnormal The smallest positive floating point number with 0 as leading bit in the mantissa following IEEE-754.
Instance Variable tiny An alias for smallest_normal, kept for backwards compatibility.
Instance Variable title Undocumented
Instance Variable xmax (1-epsneg) * beta**maxexp (the largest [in magnitude] usable floating value).
Instance Variable xmin Floating-point number beta**minexp (the smallest [in magnitude] positive floating point number with full precision).
Method _do_init Undocumented
Instance Variable _str_eps Undocumented
Instance Variable _str_epsneg Undocumented
Instance Variable _str_resolution Undocumented
Instance Variable _str_smallest_normal Undocumented
Instance Variable _str_smallest_subnormal Undocumented
Instance Variable _str_xmax Undocumented
Instance Variable _str_xmin Undocumented
def __init__(self, float_conv=float, int_conv=int, float_to_float=float, float_to_str=(lambda v: '%24.16e' % v), title='Python floating point number'): (source)

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

def __str__(self): (source)

Undocumented

Floating-point number beta**machep (floating point precision)

Same as eps.

Floating-point number beta**negep.

Radix in which numbers are represented.

Number of bits in the exponent (including its sign and bias).

In range(6), information on what kind of rounding is done in addition, and on how underflow is handled.

Number of base-ibeta digits in the floating point mantissa M.

Exponent of the smallest (most negative) power of ibeta that, added to 1.0, gives something different from 1.0

Smallest (positive) power of ibeta that causes overflow.

Smallest (most negative) power of ibeta consistent with there being no leading zeros in the mantissa.

Exponent of the smallest power of ibeta that, subtracted from 1.0, gives something different from 1.0.

Number of 'guard digits' used when truncating the product of two mantissas to fit the representation.

precision: float = (source)

- int(-log10(eps))

resolution: float = (source)

- 10**(-precision)

smallest_normal: float = (source)

The smallest positive floating point number with 1 as leading bit in the mantissa following IEEE-754. Same as xmin.

smallest_subnormal: float = (source)

The smallest positive floating point number with 0 as leading bit in the mantissa following IEEE-754.

An alias for smallest_normal, kept for backwards compatibility.

title: str, optional = (source)

Undocumented

(1-epsneg) * beta**maxexp (the largest [in magnitude] usable floating value).

Floating-point number beta**minexp (the smallest [in magnitude] positive floating point number with full precision).

def _do_init(self, float_conv, int_conv, float_to_float, float_to_str, title): (source)

Undocumented

_str_eps = (source)

Undocumented

_str_epsneg = (source)

Undocumented

_str_resolution = (source)

Undocumented

_str_smallest_normal = (source)

Undocumented

_str_smallest_subnormal = (source)

Undocumented

_str_xmax = (source)

Undocumented

_str_xmin = (source)

Undocumented