PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Tutorial 5 online

Hey,

Tutorial 5 is online. This time I explain a bit about fixed point math, using an example rotozoomer (wich I also explain).
If someone could proofread it, I will be happy to make some adjustments based on your comments.

- Jacco.
http://userwww.econ.hvu.nl/~kouwenhs/

Looks good. You may also want to mention that to add / subtract fixed point values they must be of the same precision, and that the result stays in that precision (unlike mult and div). Also, you may mention that multiplying / dividing a fixed point value by an integer (a "real" integer, not one that represents a fixed point value) doesn't result in any change in precision either.
Here are a couple formulas for determining the resulting precision of fixed point mult / div:

r1.p1 * r2.p2 = r1+r2-32.p1+p2
r1.p1 / r2.p2 = r1+32-r2.p1-p2

Where r=Range and p=Precision. Of course once you know either the range or precision of the result you can calculate the other by subtracting from 32.

Also, it may be good if you summarize with something like:
Multiplying two fixed point values has a result with less range but more precision. Dividing two fixed point values results in a value with less precision and more range.

I think your tutorial is going to bring back PQ induced fixed-point-conversion nightmares. ;)

Dan East
I've added most of your comments. Tnx. :)
erm back to tutorial 1, I can't seem to get it to compile. I get about 10 errors when linking, something to do with gx methods.
I think I have it looking in the right place for all the gx libraries and headers, but not sure about the dll.
anyone any ideas? I can't get the full error messages right now as i'm on a different machine.
thanks.
Moose or Chuck · 29 Jul 2001, 19:57 UTC
Make sure you import gx.lib into the Workspace
cheers, i'm not doing that at the moment, i'll give it a try.