home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!ut-emx!ibmchs!auschs!awdprime.austin.ibm.com!awdprime.austin.ibm.com!sdl
- From: sdl@adagio.austin.ibm.com (sdl)
- Newsgroups: comp.unix.aix
- Subject: Re: Division by zero, again...
- Message-ID: <SDL.92Nov18124455@adagio.austin.ibm.com>
- Date: 18 Nov 92 17:44:55 GMT
- References: <1dmj0cINNk47@pita.cs.huji.ac.il>
- Sender: news@awdprime.austin.ibm.com (USENET News)
- Reply-To: sdl@austin.ibm.com
- Organization: AIX Base System Kernel Development
- Lines: 31
- In-Reply-To: avinoam@sunrise.huji.ac.il's message of 9 Nov 1992 20:51:24 GMT
-
-
- In article <1dmj0cINNk47@pita.cs.huji.ac.il> avinoam@sunrise.huji.ac.il () writes:
-
- > Hi! Sorry if it is a FAQ, but I would like to know how to stop a FORTRAN
- > program to after division by zero, overflow, etc...
- > I am looking for oSomething like ieee_handler in the SunOS fortran,
- > but this time I am using xlf......
-
- There are two options. The first is the -qflttrap option for the
- Fortran compiler. This inserts trap code, and will cause SIGTRAP to
- be raised when an exception occurs. This is described in the AIX XL
- Fortran Compiler/6000 User's Guide (SC09-1354-02). This book also
- includes a sample trap handler that's useful.
-
- The second option is to use the hardware exception trapping
- facilities. Using this will cause SIGFPE to be raised when an
- exception occurs, and I think is similar to the Sun's ieee_handler.
- Look for article "Floating-Point Exceptions Overview" in info (search
- for "floating-point" to find it quickly) for an introduction to these
- services. For a Fortran example, see
-
- /usr/lpp/bos/samples/sigfpe_samp2.c (signal handler)
- /usr/lpp/bos/samples/sigfpe_samp3.f (example)
-
-
-
- --
- --------------------------------------------------------------------
- Stephen Linam AWSD Austin T/L: 678-3308 Bell-net: (512) 838-3308
- sdl@austin.ibm.com IBM VNET: LINAM at AUSTIN
- Quae narravi, nullo modo negabo. I don't speak for IBM
-