Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ihnp4!inuxc!pur-ee!j.cc.purdue.edu!k.cc.purdue.edu!ag0 From: ag0@k.cc.purdue.edu.UUCP Newsgroups: comp.lang.c Subject: Re: Help in dealing with floating point exceptions in C on UNIX/VAX Message-ID: <1800@k.cc.purdue.edu> Date: Tue, 17-Feb-87 16:05:14 EST Article-I.D.: k.1800 Posted: Tue Feb 17 16:05:14 1987 Date-Received: Fri, 27-Feb-87 03:44:22 EST References: <4441@brl-adm.ARPA> <635@sdchema.sdchem.UUCP> Reply-To: ag0@k.cc.purdue.edu.UUCP (Colin Jenkins) Organization: Purdue University Computing Center Lines: 35 Summary: Try signal In article <635@sdchema.sdchem.UUCP> tps@sdchemf.UUCP (Tom Stockfisch) writes: >In article <4441@brl-adm.ARPA> moss@BRL.ARPA (Gary S. Moss (SLCBR-VLD-V)) writes: >>See matherr(3M). >>-moss > >What system are you on? >I can't find this in either my 4.3BSD or Sys V Manual. > >|| Tom Stockfisch, UCSD Chemistry tps%chem@sdcsvax.UCSD I can't find on my 4.3 system either. I would suggest using the signal handler. You can write a function to be called when a floating point exception occurs and handle it there. #include int trapfpe(); main { signal (SIGFPE, trapfpe); . . } /* main */ trapfpe() { printf ("trapfpe: ERROR- Floating point exeption\n"); /****** Handle the error *******/ } /* trapfpe */ My usage of the signal facility is a little bit different from the manual description (which may be confusing to new programmers), but it is simple and it works. Colin