! 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 ! ! overflow.f90: determine overflow and underflow limits Program overflow Implicit none Integer :: I, N Real*8 :: under, over N = 1024 ! number of iterations, may need bigger under = 1. ! set initial values over = 1. Do I = 1, N ! calc underflow and overflow, output to screen under = under / 2 over = over * 2 write (*, *) I, over, under End Do Stop 'overflow' End Program overflow