Quote:
|
Originally Posted by sparksandtabs
I was wondering if anyone can help me with how to do floating point math on a Basic Stamp 2?
|
Quote:
|
Originally Posted by Mike
Multiply everything by 1000.
|
That'll let you represent fractional values, but it's fixed point, not floating point.
To do true floating point, you need to use a variable scaling factor rather than just picking e.g. 1000 in advance, and you have to keep track of the scaling when multiplying and dividing. (When you add or subtract, you need to equalize the scaling factors first.)