vendredi 25 août 2017

Determine if the result of successive iterations does not change within machine precision using Fortran

For a loop I want to compare the result of iteration i-1 to the result of iteration i and determine if they are equal within machine precision. More specifically, I want to compute diff = result(i) - result(i-1) and exit the loop if the value is close enough to 0.

All values are double precision, and using the statement IF (diff .EQ. 0d0) THEN; EXIT is not sufficient for my calculation.

Aucun commentaire:

Enregistrer un commentaire