home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / acorn / tech / 1188 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  1.3 KB

  1. Path: sparky!uunet!munnari.oz.au!comp.vuw.ac.nz!newshost.wcc.govt.nz!kosmos.wcc.govt.nz!mckay_g
  2. From: mckay_g@kosmos.wcc.govt.nz
  3. Newsgroups: comp.sys.acorn.tech
  4. Subject: Re: Suppressing floating point errors in C
  5. Date: 8 Jan 93 23:32:17 NZST
  6. Organization: Welligton City Council, Public Access.
  7. Lines: 21
  8. Message-ID: <1993Jan8.233217.1@kosmos.wcc.govt.nz>
  9. References: <memo.845760@cix.compulink.co.uk>
  10. NNTP-Posting-Host: kosmos.wcc.govt.nz
  11.  
  12. In article <memo.845760@cix.compulink.co.uk>, pmoore@cix.compulink.co.uk 
  13. (Paul Moore) writes:
  14. > The following code, when compiled, generates a stack backtrace,
  15. > and the program exits with status zero. How do I get the program
  16. > to continue to the "return 0"? (Note: I KNOW ignoring FP errors
  17. > is not good in the general case - in this case, and in the "real"
  18. > case where this is a problem for me, the naff value in d is never
  19. > used, and so is harmless.)
  20.  
  21.     [ Program deleted to overcome a stupid limitation of this silly news
  22.       reader where you have to write more lines than you quote!]
  23.  
  24. The way I would overcome this problem is to change the FPU status/control
  25. register to prevent what ever type of FP errors you wish to ignore.  The only
  26. problem with this is that you would have to remember these registers and
  27. restore them when you exit your program or if it is running under the wimp,
  28. every time you call wimp_poll.
  29.  
  30. Rob.
  31.  
  32.  
  33.