The function subprogram AMACH retrieves machine constants that define the computer's single-precision or double precision arithmetic. Such floating-point numbers are represented in normalized N-digit, base B form as
where s is the sign, 0 < x1 < B, 0 ≤ xk < B, k = 2, ¼, N and
See Comment 1 for a description of the use of the generic version of this function.
See Comment 2 for a description of min, max, and N.
I — Index of the desired constant. (Input)
Specific: The specific interface names are S_AMACH and D_AMACH.
Double: The double precision name is DMACH.
1. If the generic version of this function is used, the immediate result must be stored in a variable before use in an expression. For example:
X = AMACH(I)
Y =
SQRT(X)
must be used rather than
If this is too much of a restriction on the programmer, then the specific name can be used without this restriction..
2. Note that for single precision
B = IMACH(6), N =
IMACH(7).
Emin = IMACH(8),
and Emax = IMACH(9).
For double precision
B = IMACH(6), N =
IMACH(10).
Emin = IMACH(11),
and Emax = IMACH(12).
3. The IEEE standard for binary arithmetic (see IEEE 1985) specifies quiet NaN (not a number) as the result of various invalid or ambiguous operations, such as 0/0. The intent is that AMACH(6) return a quiet NaN. On IEEE format computers that do not support a quiet NaN, a special value near AMACH(2) is returned for AMACH(6). On computers that do not have a special representation for infinity, AMACH(7) returns the same value as AMACH(2).
|
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |