machconst - Fortran Fortran callable library for machine constants
machconst provides Fortran callable routines to return information about the ``machine constants'' for a platform. It is based upon the C routines included in the d1mach.f, i1mach.f and r1mach.f files available from Netlib (http://www.netlib.org).
machconst provides three functions, d1mach
, i1mach
, and
r1mach
each of which is passed a single integer argument which
indicates which value is to be returned.
D1MACH( 1) = B**(EMIN-1) the smallest positive magnitude.
D1MACH( 2) = B**EMAX*(1 - B**(-T)) the largest magnitude.
D1MACH( 3) = B**(-T) the smallest relative spacing.
D1MACH( 4) = B**(1-T) the largest relative spacing.
D1MACH( 5) = LOG10(B)
I1MACH( 1) = the standard input unit.
I1MACH( 2) = the standard output unit.
I1MACH( 3) = the standard punch unit.
I1MACH( 4) = the standard error message unit.
I1MACH( 5) = the number of bits per integer storage unit.
I1MACH( 6) = The number of characters per character storage unit. For fortran 77, this is always 1. For fortran 66, character storage unit = integer storage unit.
Assume integers are represented in the s-digit, base-a form
SIGN ( X(S-1)*A**(S-1) + ... + X(1)*A + X(0) )
where 0 < X(I)
< A for I=0,...,S-1.
I1MACH( 7) = A, the base.
I1MACH( 8) = S, the number of base-a digits.
I1MACH( 9) = A**S - 1, the largest magnitude.
Assume floating-point numbers are represented in the t-digit, base-b form
SIGN (B**E)*( (X(1)/B) + ... + (X(T)/B**T) )
where
0 < X(I) < B for I=1,...,T, 0 < X(1), and EMIN <= E <= EMAX.
I1MACH(10) = B, THE BASE.
I1MACH(11) = T, the number of base-b digits.
I1MACH(12) = EMIN, the smallest exponent e.
I1MACH(13) = EMAX, the largest exponent e.
I1MACH(14) = T, the number of base-b digits.
I1MACH(15) = EMIN, the smallest exponent e.
I1MACH(16) = EMAX, the largest exponent e.
R1MACH(1) = B**(EMIN-1), the smallest positive magnitude.
R1MACH(2) = B**EMAX*(1 - B**(-T)), the largest magnitude.
R1MACH(3) = B**(-T), the smallest relative spacing.
R1MACH(4) = B**(1-T), the largest relative spacing.
R1MACH(5) = LOG10(B)
Public Domain (no explicit copyright).
This documents version 1.1.0 of machconst.
Various