Quote:
Originally posted by Rickertsen2
Also is it possible to divide a byte variable by a decimal and just have the answer rounded?
|
No. PBASIC knows nothing of decimals. The only division you can do is integer. If you want to round though, you can add 1/2 the divisor to the dividend before dividing. This will insure correct rounding of the quotient.
By the way, it is oft repeated that the BASIC Stamp doesn't handle negative numbers. This is NOT true. It will add, subtract, and multiply negative numbers correctly. IT WILL NOT DIVIDE CORRECTLY, though.