! From: "COMPUTATIONAL PHYSICS, 2nd Ed" ! by RH Landau, MJ Paez, and CC Bordeianu ! Copyright Wiley - VCH, 2007. ! Electronic Materials copyright: R Landau, Oregon State Univ, 2007; ! MJ Paez, Univ Antioquia, 2007; and CC Bordeianu, Univ Bucharest, 2007. ! Supported by the US National Science Foundation ! ! limit.f90: determines the machine precision ! Program limit ! determines the machine precision Implicit none Integer :: I, N Real*8 :: eps, one N = 60 ! number of iterations N eps = 1. ! set initial values one = 1.0 ! add eps to one and print result Do I = 1, N eps = eps / 2 one = 1 + eps write (*, *) I, one, eps End Do Stop 'limit' End Program limit