Table of contents Index

Module bhoelHelper.machar

Declared in module bhoelHelper

def machar()
string __author__ = 'Berthold H\366llmann, bhoel@starship.python.net'
string __file__ = '../bhoelHelper/machar.pyc'
string __version__ = '1.1'
float eps = 2.22044604925e-16
float epsneg = 1.11022302463e-16
int ibeta = 2
int iexp = 11
int irnd = 5
int it = 53
int machdep = -52
int maxexp = 1024
int minexp = -1022
int negep = -53
int ngrd = 0
float xmax = 1.79769313486e+308
float xmin = 2.22507385851e-308

Description

Function to determine machine-specific parameters affecting floating-point arithmetic.

This is build after "NUMERICAL RECIPES in C", second edition, Reprinted 1996, pp. 889.

machar()

Determines and returns machine-specific parameters affecting floating-point arithmetic. Returned values include:

ibeta
The radix in which numbers are represented, almost always 2, but occasionally 16, or even 10
it
The number of base-'ibeta' digits in the floating point mantissa
machep
Is the exponent of the smallest (mos negative) power if ibeta that, added to 1.0 gives something different from 1.0.
eps
Is the floating-point number ibeta'**'machdep, loosly referred to as the 'floating-point precision.'
negep
Is the exponenet of the smalles power of ibeta that, subtracted from 1.0, gives something different from 1.0.
epsneg
Is ibeta'**'negep, another way of defining floating-point precision. Not infrequently epsneg is 0.5 times eps; occasionally eps and epsneg are equal.
iexp
Is the number of bits in the exponent (including its sign or bias)
minexp
Is the smallest (most negative) power if ibeta consistent with there no leading zeros in the mantissa.
xmin
Is the floating-point number ibeta'**'minexp, generally the smallest (in magnitude) usable floating value
maxexp
Is the smallest (positive) power of ibeta that causes overflow.
xmax
Is (1-'epsneg')x'ibeta'**'maxexp', generally the largest (in magnitude) usable floating value.
irnd
Returns a code in the range 0...5, giving information on what kind of rounding is done in addition, and on how underflow is handled.
If irnd returns 2 or 5, then your computer is compilant with the IEEE standard for rounding. If it returns 1 or 4, then it is doing some kind of rounding, but not the IEEE standard. If irnd returns 0 or 3, then it is truncating the result, not rounding it. ngrd -- Is the number of 'guard digits' used when truncating the ploduct of two mantissas to fit the representationThis is taken from "NUMERICAL RECIPES in C", second edition, Reprinted 1996.
Author: Berthold H\366llmann
Version: 1.1