Prev Next d1mach

Implementation of Cmlib d1mach Routine in Cpp

Syntax
d = d1mach_(i)

Purpose
This routine uses the C++ standard numeric_limits to implement the specifications required by the cmlib Fortran routine d1mach.

i
The argument i has prototype
     integer* 
i
It specifies which machine constant to evaluate.

d
The return value d has prototype % doublereal %d% % and is the value of the requested machine constant.

Mapping
The Fortran definition for the machine constants below was extracted from the comments in the Fortran routine d1mach. The C++ definitions were extracted from the numeric_limits section of the C++ standard.
i d
1 B**(EMIN-1), the smallest positive magnitude.
2 B**EMAX*(1 - B**(-T)), the largest magnitude.
3 B**(-T), the smallest relative spacing.
4 B**(1-T), the largest relative spacing.
5 LOG10(B).

Input File: lib/d1mach.cpp