Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!bagate!cbmvax!chrisg From: chrisg@cbmvax.commodore.com (Chris Green) Newsgroups: comp.sys.amiga.programmer Subject: Re: Switching between integer and floating point Message-ID: <20935@cbmvax.commodore.com> Date: 25 Apr 91 13:47:47 GMT References: <1991Apr24.041205.1588@netcom.COM> Reply-To: chrisg@cbmvax.commodore.com (Chris Green) Organization: Commodore, West Chester, PA Lines: 27 In article <1991Apr24.041205.1588@netcom.COM> rodent@netcom.COM (Ben Discoe) writes: > > I've been working on a 3D object viewer intended for PD release, with >source, as soon as it's stable. My problem is this: when the project was >started, I only had a 1000 to work on, so I wrote all the math using >two kinds of fixed-point integer math (one kind for angles, another for >coordinates). > Now I (and many people who may want the code) are on accelerated >systems with 6888x's, so I'd like to include a compile-time flag to >compile with floating-point math instead of the integers. I'm sure many >other people have faced this same problem: how do you keep one source >with two different kinds of math involved? Unless you have precision problems with your fixed point, you'd be better off keeping it, even on a 68882 system, since it will still be faster. A far better option for people with 020's and 030's is keeping the fixed point, but going to 32 bit precision, and using the 32x32->64 multiply and 64/32->32:32 divide instructions available on these processors. -- *-------------------------------------------*---------------------------* |Chris Green - Graphics Software Engineer - chrisg@commodore.COM f | Commodore-Amiga - uunet!cbmvax!chrisg n |My opinions are my own, and do not - killyouridolssonicdeath o |necessarily represent those of my employer.- itstheendoftheworld r *-------------------------------------------*---------------------------d