![]() |
Floating point math in PBASIC
I was wondering if anyone can help me with how to do floating point math on a Basic Stamp 2? I know your not directly able to do it on them but is there anyway to get around it?
|
Re: Floating point math in PBASIC
Multiply everything by 1000.
1.759 becomes 1759 3.14 becomes 3140 etc. |
Re: Floating point math in PBASIC
Quote:
Quote:
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.) |
| All times are GMT -5. The time now is 04:32. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi