Xref: utzoo comp.lang.fortran:5358 comp.unix.aix:5031 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!weyrich!orville From: orville@weyrich.UUCP (Orville R. Weyrich) Newsgroups: comp.lang.fortran,comp.unix.aix Subject: Re: HELP! Need Decent RS6000 Fortran Compiler! Message-ID: <1991May10.155640.7390@weyrich.UUCP> Date: 10 May 91 15:56:40 GMT References: <1991May04.200345.26241@turnkey.tcc.com> <1991May9.015512.27264@murdoch.acc.Virginia.EDU> Reply-To: orville@weyrich.UUCP (Orville R. Weyrich) Organization: Weyrich Computer Consulting Lines: 56 In article <1991May9.015512.27264@murdoch.acc.Virginia.EDU> gl8f@astsun.astro.Virginia.EDU (Greg Lindahl) writes: >In article jkorpela@vipunen.hut.fi (Jukka Korpela) writes: > >>I'm struggling, among other things, with the problem of detecting the >>occurrence of floating-point errors. (I've abandoned the hope of ever really >>trapping them...) > >On the RS/6000, it seems that FORTRAN doesn't have anything special, >but that the fp_enable stuff could be used to get the processor to >signal on things like divide by zero instead of merrily going on. >Amazing that the Fortran manual has no mention of this nor an example. >Hmph. Of course the FORTRAN *LANGUAGE* does not contain a definition of how FP errors are to be handled. The language is designed to be compatible with all sorts of obsolete antique hardware, and the hardware folks would never agree to make FORTRAN adhere to something like the IEEE floating point standard (sarcasm here). If they did, the next thing the software folks would try to do would be to make adherence to ASCII standard (more sarcasm). The only language that I am aware of that has any sort of floating-point error handling built into thae standard is Ada, and even that does not support the IEEE floating-point very well. On the other hand, the FORTRAN standard is permissive, and if a vendor WANTED to embrace industry standards by providing IEEE floating point support, they could do so without violating the FORTRAN standard. Who did you say made your RS/6000? On a more positive note, I seem to recall that the IBM-370 FORTRAN manuals were divided into separate books for the language users and for those poor folks that had to do system level program integration. The (nonstandard) IBM library routines for controlling the handling of run-time errors were I think documented in the PROGRAMMER'S REFERENCE, not the LANGUAGE REFERENCE. In any event, the facility was provided to either ignore FP errors, to invoke an error handler, or to abort. If you chose to ignore FP errors, you could poll the run-time system to determine how many times such an error had occurred since the last time you asked. One would hope that in the absence of adherence to the international FP standard, the RS/6000 would at least attempt to maintain compatibility with IBM-370 FORTRAN. I don't know. My advice would be to get an industry-standard i486 machine to code on, and use a Borland language that you can buy the run-time code for so that you can be sure that the FP errors are handled the way you want them to be. (I don't know about the currernt Borland products, but the version 3.0 of Pascal did not quite get the error handling right. Since this is comp.lang.fortran rather than Pascal, e-mail me for details). -------------------------------------- ****************************** Orville R. Weyrich, Jr., Ph.D. Certified Systems Professional Internet: orville%weyrich@uunet.uu.net Weyrich Computer Consulting Voice: (602) 391-0821 POB 5782, Scottsdale, AZ 85261 Fax: (602) 391-0023 (Yes! I'm available) -------------------------------------- ******************************