Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!dimacs.rutgers.edu!bcm!convex!texsun!male!newstop!exodus!exodus-bb!khb From: khb@chiba.Eng.Sun.COM (Keith Bierman fpgroup) Newsgroups: comp.lang.fortran Subject: Re: IEEE exceptions Message-ID: Date: 27 Feb 91 23:34:42 GMT References: <91963@lll-winken.LLNL.GOV> <1991Feb27.205044.18345@midway.uchicago.edu> Sender: news@exodus.Eng.Sun.COM Distribution: usa Organization: Sun MegaSystems Lines: 45 In-reply-to: carlo@oddjob.uchicago.edu's message of 27 Feb 91 20:50:44 GMT In article <1991Feb27.205044.18345@midway.uchicago.edu> carlo@oddjob.uchicago.edu (Carlo Graziani) writes: It's a bit of a kludge, but at least it allows identification of the routine within which the exception occurred, and the problem can usually be identified using dbx: why not just do as the documentation suggests: ieeer=ieee_handler('set','common',SIGFPE_ABORT) ! aka %val(2), see ! Fortran Users Guide ! f77_floatingpoint.h, etc. the traceback (v1.3) and/or dbx where then shows the location of the event. If you compiled -g you get the exact line number. it would dawn on the *%&#!@!? C programmers who developed Fortran for the Sun that for the purposes of scientific programming, failure to *automatically* halt on division by zero is a bug, not a feature :-(> . compiling -fnonstnd has that effect. Due to a minor bug in v1.3 one can't completely rely on it; but it is robust in v1.4. IEEE 754 had a fair amount of Fortran influence.X3J3, the fortran committee has never made any statement about the "correct" behavior of /0 etc. .... by choice. As it happens, I am a Fortran programmer (I still run and write more of it than C) and I don't want the machine to necessarily halt. I've made a fair number of codes run faster because I was able to defer checking until after the critical computations .... Since there clearly are folks who do want the system to halt, we made it a 1-line change to the code, if you want non-ieee compliant behavior .... and eventually even a compiler option. Hopefully that comes close enough to what you desire.... cheers -- ---------------------------------------------------------------- Keith H. Bierman kbierman@Eng.Sun.COM | khb@chiba.Eng.Sun.COM SMI 2550 Garcia 12-33 | (415 336 2648) Mountain View, CA 94043