Eric,
You should not get a warning with .lt.
You would if you wrote 'if ( d .eq. 1.0 )', where the more 'robust' method is to write: if ( abs(d-1.0) < error ).
For an estimate of error, there are a few considerations:
- the intrinsic epsilon() gives an indication of the smallest possible value for error, although
- you want to choose a larger value if near enough is close enough.
- note that error varies with value, so something like:
if ( abs(d-x) < epsilon()xsafety_factor ) would be an estimate of error
or error = max ( epsilon()xsafety_factor, 1.e-10 )
Often it is easier to just use ' if ( d .eq. 1.0 ) ' and ignore the error, although if there is any round-off error in calculating d, the test could fail.
John