Skip to content

Instantly share code, notes, and snippets.

@certik
Created May 26, 2011 22:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save certik/994243 to your computer and use it in GitHub Desktop.
Save certik/994243 to your computer and use it in GitHub Desktop.
Fortran epsilon test
program test
implicit none
integer, parameter :: dp = 8
real(dp) :: a, b
a = 1.0_dp
b = a + epsilon(1.0_dp)
print *, "First we show, that we have two different 'a' and 'b':"
print *, "a == b:", a == b, "b-a:", b-a
print *, "using (es22.15)"
print "(es22.15)", a
print "(es22.15)", b
print *, "using (es23.16)"
print "(es23.16)", a
print "(es23.16)", b
end program
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment