Article View: comp.sys.acorn.tech
Article #857Re: Suppressing floating point errors in C
From: mckay_g
Date: Fri, 08 Jan 1993 11:32
Date: Fri, 08 Jan 1993 11:32
19 lines
1402 bytes
1402 bytes
In article <memo.845760@cix.compulink.co.uk>, pmoore@cix.compulink.co.uk (Paul Moore) writes: > The following code, when compiled, generates a stack backtrace, > and the program exits with status zero. How do I get the program > to continue to the "return 0"? (Note: I KNOW ignoring FP errors > is not good in the general case - in this case, and in the "real" > case where this is a problem for me, the naff value in d is never > used, and so is harmless.) [ Program deleted to overcome a stupid limitation of this silly news reader where you have to write more lines than you quote!] The way I would overcome this problem is to change the FPU status/control register to prevent what ever type of FP errors you wish to ignore. The only problem with this is that you would have to remember these registers and restore them when you exit your program or if it is running under the wimp, every time you call wimp_poll. Rob.
Technical Details
Message-ID:
<1993Jan8.233217.1@kosmos.wcc.govt.nz>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!comp.vuw.ac.nz!newshost.wcc.govt.nz!kosmos.wcc.govt.nz!mckay_gReferences:
<memo.845760@cix.compulink.co.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!comp.vuw.ac.nz!newshost.wcc.govt.nz!kosmos.wcc.govt.nz!mckay_g From: mckay_g@kosmos.wcc.govt.nz Newsgroups: comp.sys.acorn.tech Subject: Re: Suppressing floating point errors in C Date: 8 Jan 93 23:32:17 NZST Organization: Welligton City Council, Public Access. Lines: 21 Message-ID: <1993Jan8.233217.1@kosmos.wcc.govt.nz> References: <memo.845760@cix.compulink.co.uk> NNTP-Posting-Host: kosmos.wcc.govt.nz