/* Output from p2c 1.21alpha-07.Dec.93, the Pascal-to-C translator */ /* From input file "exponentmax.p" */ #include /* exponentmax: determine the largest argument of the exp() function Dr. Thomas D. Schneider National Institutes of Health National Cancer Institute Center for Cancer Research Nanobiology Program Molecular Information Theory Group Frederick, Maryland 21702-1201 toms@ncifcrf.gov permanent email: toms@alum.mit.edu (use only if first address fails) http://www.ccrnp.ncifcrf.gov/~toms/ */ /* end of program */ /* begin module version */ #define version 1.00 /* of exponentmax.p 2006 Nov 20 2006 Nov 20, 1.00: origin */ #define updateversion 1.00 /* defines lowest acceptable current parameter file */ /* end module version */ /* begin module describe.exponentmax */ /* name exponentmax: determine the largest argument of the exp() function synopsis exponentmax(output: out) files output: messages to the user description At some value of x, exp(-x) is too large for a particular computer. Determine the value. The program will crash at that point. examples For the GPC compiler on a SunBlade 2000, exponentmax 1.00 x = 1, exp(-x) = 3.679e-01 x = 2, exp(-x) = 1.353e-01 x = 3, exp(-x) = 4.979e-02 ... x = 743, exp(-x) = 1.98e-323 x = 744, exp(-x) = 9.88e-324 x = 745, exp(-x) = 4.94e-324 ./exponentmax: error in exponentiation (Result too large) (error #700 at 180f3) documentation see also higa.p author Thomas Dana Schneider bugs technical notes */ /* end module describe.exponentmax */ /* begin module exponentmax.themain */ Static Void themain() { /* the main procedure of the program */ double parameterversion; /* parameter version number */ long x; /* value to find the maximum of */ printf("exponentmax %4.2f\n", version); for (x = 1; x <= 1000; x++) printf("x = %4ld, exp(-x) = % .3E\n", x, exp((double)(-x))); } /* end module exponentmax.themain */ main(argc, argv) int argc; Char *argv[]; { PASCAL_MAIN(argc, argv); themain(); _L1: exit(EXIT_SUCCESS); } /* End. */