home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / aix / 11766 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  1.9 KB

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