From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <478210ed2d7b845af72457e5f9dc418e.axp-list@archive.invalid> X-Archive-Original-Message-ID: <199802120049.TAA07622@ulexite.nist.gov> Date: Wed, 11 Feb 1998 21:17:13 -0500 (EST) From: Francesco Callari Subject: Another Floating Point Weirdness Apropos of FP weirdness. Can someone tell me why the following program will get a floating point exception (SIGFPE) ? #include #include #include int main(int argc, char* argv[]) { int i, j; double v,m; /* works fine with m=0.0 */ assert(finite(m)); /* passes this test */ for (j=-10; j<=0; j++) { v=exp(-(double)j); if (v > m ) { /* dies with SIGFPE here */ m=v; } } } System config is kernel 2.0.32 libm-2.0.6.so libc-2.0.6.so cpu : Alpha cpu model : EV56 PC164LX Ciao Franco ------------------------------------------------------------------------- Franco Callari Centre for Intelligent Machines "Beati coloro che hanno fame e sete McGill University, 3480 University di giustizia, perche` saranno Montreal, Quebec, Canada, H3A 2A7 giustiziati." (P. Bellocchio) franco@cim.mcgill.ca | phone: +(514) 398-3371 | fax: +(514) 398-7348 WWW: