Shop OBEX P1 Docs P2 Docs Learn Events
seeking help on Basic stamp''s 16 Bit counter limitations — Parallax Forums

seeking help on Basic stamp''s 16 Bit counter limitations

ArchiverArchiver Posts: 46,084
edited 2003-10-27 16:13 in General Discussion
>Hello everyone,
>
>
>I have recently started using Basic Stamp so I am not too familiar
>with all the functions and capabilites of Basic Stamp. I am seeking
>help on calculating numbers which exceed Basic Stamp's 16 Bit counter
>limitation. (counter can not exceed more than 65535)
>
>I need to insert the following formula in my source code
>
>G = 70000000 (A) x 45456(B)/100000(C)
>
>values for (A) and (C) remain constant, whereas values for (B) vary
>from period to period.
>
>Thanking you in advance for any suggestions and solutions.
>I can be reached at noman_suliman@y...
>
>Best regards,
>
>Noman

with A and C constant, it is really the same thing as G = 700*B. Or,
G = 7*(B/10)*1000. The Stamp can do this:
G = 7 * (B/10)
debug dec G,"000",cr ' or kilo-units

OR, can round off before division, like this:
G = 7 * (B+5/10)

Their are other methods that work if the constants are not such neat
powers of ten.

-- Tracy
Sign In or Register to comment.