MACHAR - Dynamically Compute Machine Constants

MACHAR is a routine to compute constants that characterize the floating point arithmetic system on a computer. This includes the value of the "machine epsilon", the smallest number that can be added to 1 and make a difference. However, it includes many other quantities of interest, including the arithmetic base, the largest and smallest magnitudes, and so on.

The original routine was written in FORTRAN, and a copy of that is available in the FORTRAN MACHAR directory. A C "translation" was supplied as part of ACM algorithm 722, and that is what is given here.

Reference 1:
W J Cody,
ACM Algorithm 665, MACHAR, a subroutine to dynamically determine machine parameters,
ACM Transactions on Mathematical Software,
Volume 14, Number 4, pages 303-311, 1988.
Reference 2:
W J Cody and W Waite,
Software Manual for the Elementary Functions,
1980.

Files you may copy include:

The list of routines includes:

Return to the C software page.


Last revised on 19 November 2001.