IDL

MACHAR

MACHAR

The MACHAR function determines and returns machine-specific parameters affecting floating-point arithmetic. Information is returned in the form of a structure with the fields listed in the “Return Value” section.

MACHAR is based on the routine machar described in section 20.1 of Numerical Recipes in C: The Art of Scientific Computing (Second Edition), published by Cambridge University Press, and is used by permission. See that section for more details on and sample values of the various parameters returned.

Syntax


Result = MACHAR( [, /DOUBLE] )

Return Value


The following table lists the fields in the structure returned from the MACHAR function:

MACHAR Fields

Field Name

Description

IBETA

The radix in which numbers are represented. A longword integer.

IT

The number of base-IBETA digits in the floating-point mantissa M. A longword integer.

IRND

A code in the range 0 – 5 giving information on what type of rounding is done and how underflow is handled. A longword integer.

NGRD

The number of “guard digits” used when truncating the product of two mantissas. A longword integer.

MACHEP

The exponent of the smallest power of IBETA that, added to 1.0, gives something different from 1.0. A longword integer.

NEGEP

The exponent of the smallest power of IBETA that, subtracted from 1.0, gives something different from 1.0. A longword integer.

IEXP

The number of bits in the exponent. A longword integer.

MINEXP

The smallest value of IBETA consistent with there being no leading zeros in the mantissa. A longword integer.

MAXEXP

The smallest positive value of IBETA that causes overflow. A longword integer.

EPS

The floating-point number IBETAMACHEP, loosely referred to as the “floating-point precision.”

EPSNEG

The floating-point number IBETANEGEP, which is another way of determining floating-point precision.

XMIN

The floating-point number IBETAMINEXP, generally the magnitude of the smallest usable floating-point value.

XMAX

The largest usable floating-point value, defined as the number (1-EPSNEG)xIBETAMAXEXP.

Arguments


None

Keywords


DOUBLE

The information returned is normally for single-precision floating-point arithmetic. Specify DOUBLE to see double-precision information.

Version History


4.0

Introduced

See Also


CHECK_MATH, !VALUES

Notes


This page has no user notes yet. Be the first one!


This information is not subject to the controls of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However, it may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
© 2014 Exelis Visual Information Solutions