Mir 1.0
Mir application programming interface
Numerical Recipies

Modules

 Singular Value Decomposition
 
 Symmetrical Eigensystems
 
 Sorting
 
 Random numbers
 
 Interpolation
 

Functions

void mirml_nr_machar_double (int *ibeta, int *it, int *irnd, int *ngrd, int *machep, int *negep, int *iexp, int *minexp, int *maxexp, double *eps, double *epsneg, double *xmin, double *xmax)
 Determines machine-specific parameters affecting double floating-point arithmetic. More...
 
void mirml_nr_machar_float (int *ibeta, int *it, int *irnd, int *ngrd, int *machep, int *negep, int *iexp, int *minexp, int *maxexp, float *eps, float *epsneg, float *xmin, float *xmax)
 Determines machine-specific parameters affecting single floating-point arithmetic. More...
 

Detailed Description

Function Documentation

◆ mirml_nr_machar_double()

void mirml_nr_machar_double ( int *  ibeta,
int *  it,
int *  irnd,
int *  ngrd,
int *  machep,
int *  negep,
int *  iexp,
int *  minexp,
int *  maxexp,
double *  eps,
double *  epsneg,
double *  xmin,
double *  xmax 
)

Determines machine-specific parameters affecting double floating-point arithmetic.

Parameters
[out]ibetaRadix in which numbers are represented, almost always 2, but historically sometimes 16, or even 10.
[out]itNumber of base-ibeta digits in the floating-point mantissa M.
[out]irndReturns a code in the range 0-5, giving information on what kind of rounding is done in addition, and on how underflow is handled.
[out]ngrdNumber of "guard digits" used when truncating the product of two mantissas to fit the representation.
[out]machepExponent of the smallest (most negative) power of ibeta that, added to 1.0, gives something different from 1.0.
[out]negepExponent of the smallest power of ibeta that, subtracted from 1.0, gives something different from 1.0.
[out]iexpNumber of bits in the exponent (including its sign or bias).
[out]minexpSmallest (most negative) power of ibeta consistent with there being no leading zeros in the mantissa.
[out]maxexpSmallest (positive) power of ibeta that causes overflow.
[out]epsFloating-point number ibetamachep, loosely referred to as the "floating-point precision".
[out]epsnegibetanegep, another way of defining floating-point precision. Not infrequently, epsneg is 0.5 times eps; occasionally eps and epsneg are equal.
[out]xminFloating-point number ibetaminexp, generally the smallest (in magnitude) useable floating value.
[out]xmax(1-epsneg)*ibetamaxexp, generally the largest (in magnitude) useable floating value.
Note
A part of text from NR: "If \a irnd is 2 or 5, then your processor is compliant with IEEE standard. @note If it returns 1 or 4, then it is doing some kind of rounding, but not the IEEE standard. @note If \a irnd returns 0 or 3, then it is truncating the result, not rounding it — not desirable. @note The other issue addressed by irnd concerns underflow. If a floating value is @note less than \a xmin, many computers underflow its value to zero. Values \a irnd = 0, 1, or 2 @note indicate this behavior. The IEEE standard specifies a more graceful kind of @note underflow: As a value becomes smaller than \a xmin, its exponent is frozen at the @note smallest allowed value while its mantissa is decreased, acquiring leading zeros and @note "gracefully" losing precision. This is indicated by irnd = 3, 4, or 5.
Sometimes results can be compiler-dependent. For example, some compilers
underflow intermediate results ungracefully, yielding irnd = 2 rather than 5.

◆ mirml_nr_machar_float()

void mirml_nr_machar_float ( int *  ibeta,
int *  it,
int *  irnd,
int *  ngrd,
int *  machep,
int *  negep,
int *  iexp,
int *  minexp,
int *  maxexp,
float *  eps,
float *  epsneg,
float *  xmin,
float *  xmax 
)

Determines machine-specific parameters affecting single floating-point arithmetic.

Note
For description of arguments see mirml_nr_machar_double.