Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site othervax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!bbnccv!bbncca!linus!philabs!micomvax!othervax!scott From: scott@othervax.UUCP (Scott Pace) Newsgroups: net.unix-wizards Subject: floating point overflows (and how to catch them), HELP! Message-ID: <691@othervax.UUCP> Date: Thu, 29-Aug-85 09:59:33 EDT Article-I.D.: othervax.691 Posted: Thu Aug 29 09:59:33 1985 Date-Received: Sun, 1-Sep-85 05:59:57 EDT Reply-To: scott@otherva.UUCP (Scott Pace) Organization: Philips Information Systems - St. Laurent P.Q., Canada Lines: 38 If I compile and run the following program, it will continue until a floating point overflow occurs and will then go and proccess the interrupt routine. However, it seems that the return from the interrupt routine is returning to the start of the instruction which caused the overflow in the first place. Therefore, the program just goes into an infinite loop printing the overflow message. What exactly is happening here or what am I doing wrong ? Any help greatly appreciated. By the way, this is on a VAX11/780 running 4.1BSD #include int fpe_flag = 0; main() { double a = 1.0,b = 2.0; int fltover(); sigset(SIGFPE,fltover); for (;;) { a *= b; /* overflow here */ if (fpe_flag) exit(1); } } fltover() { printf("Floating point overflow\n"); fpe_flag = 1; } Cheers, Scott Pace, ...!philabs!micomvax!othervax!scott