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