Page 1 of 1

Fixed point class & Intels GPP

PostPosted: Oct 4, 2005 @ 1:54pm
by torbent

Re: Fixed point class & Intels GPP

PostPosted: Oct 10, 2005 @ 11:06am
by pappaxray
If you saturate on multiply you might get some odd behaviour depending on what the calculation is. In some cases this might not be too bad (graphical glitch) but in something like the collision this could mean you fall through the floor. Imo, its better to make sure your inputs never get that large and do an assert on your multiply function to check for overflow (check if the sign has changed, or if the top bits in your temporary (if ur doing 32x32->64) aren't all 1 or 0), you could use that check to saturate if you wanted.

Passing that float into the constructor should just compile to a constant load, might be worth checking the assembler.