home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / graphics / 13264 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  1.7 KB

  1. Path: sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!merlin!iwsd01.itwol.bhp.com.au!wewila
  2. From: wewila@iwsd01.itwol.bhp.com.au (Alan Wilkie)
  3. Newsgroups: comp.graphics
  4. Subject: POV Arithmetic fault (on VAX)
  5. Message-ID: <1992Dec30.133254.25@iwsd01.itwol.bhp.com.au>
  6. Date: 30 Dec 92 13:32:54 +1000
  7. Organization: BHP Information Technology
  8. Lines: 28
  9.  
  10. I don't know whether this problem is related to the POV problems being
  11. discussed earlier in this group (black lines, etc), but I wonder if it
  12. might be a bug worth reporting.
  13.  
  14. I compiled POV on a VAX and several of the sample scene descriptions crash
  15. with arithmetic faults.  I haven't had time to figure out exactly why,
  16. but I was able to get around it with a bit of code modification.  In VECT.C
  17. (and elsewhere) there are tests like :
  18.  
  19.     if (lf == 0.0 || lf * f < 0)
  20.  
  21. Sometimes, lf * f seems to generate an arithmetic under/over flow (I'm not
  22. sure which).  Anyway, all I did was replace the test with :
  23.  
  24.     if (lf == 0.0 || (lf > 0.0 && f < 0.0) || (lf < 0.0 && f > 0.0))
  25.  
  26. This achieves the same result without the multiplication (hence avoiding the
  27. arithmetic fault).  It may also have the side effect of a slight speed up
  28. (since multiplication is so much slower than subtraction) - don't know
  29. for sure :-).
  30. -- 
  31. -------------------------------------------------------------------/\/\---
  32. Alan Wilkie, Analyst/Programmer, Process & Engineering Section    / / /\
  33.                 BHP Information Technology, Wollongong Australia / / /  \
  34. Mail      :     P.O. Box 261, Warrawong 2502                    / / / /\ \
  35. Telephone :     +61 42 755667 Fax: +61 42 755215                \ \/ / / /
  36. Internet  :     wewila@iwsd01.itwol.bhp.com.au                   \  / / /
  37. ------------------------------------------------------------------\/\/\/--
  38.