/* 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; & CC Bordeianu, Univ Bucharest, 2007 Support by National Science Foundation */ // over.c: Determine overflow and underflow limits #include #define N 1024 // might not be big enough to cause // over and underflow main() { double under = 1., over = 1.; // starting values int i; for (i = 0; i<1024; i++) { under /= 2.; // divide by two over *= 2.; // multiply by two printf("%d. under: %e over: %e \n",i+1,under,over); } }