One of the first things I was taught in my Fortran course some 30+ years ago was that testing two real variables (single or double precision) for equality was not reliable and that round-off errors may give a false result. On the other hand, comparing two integers is always accurate. Does this rule still hold true for real variables? In particular, will the following code always produce the correct result. I am willing to accept numbers that differ by less than epsilon(1.0d0) to be considered equal.
a = 1.0d0
b = 1.0d0
if (all(a == b)) then
print *, 'arrays are have equal values'
print *, 'arrays are different'
end program main