My attached program is supposed to divide 2 integer values and use the result in another calculation.
The sorts of values for b1 and b2 that I tend to get are about 210 and 120 respectively, which is supposed to trigger the 'OK' message, but unless b2 is below about 85 it always says 'repeat'. As b4 = b1/b2, it's not likely to be an integer value... duh. I think its just a data type issue, but not sure
b4 needs to have 2 significant figures; I'm not familiar with picaxe basics odd arithmetic syntax; if b4 was 100 * (b1/b2), then b4 could just be an integer, but will basic actually divide like this, and use a non integer value during its calculation?
Or would I be better with a different data type?
Thanks,
M21
The sorts of values for b1 and b2 that I tend to get are about 210 and 120 respectively, which is supposed to trigger the 'OK' message, but unless b2 is below about 85 it always says 'repeat'. As b4 = b1/b2, it's not likely to be an integer value... duh. I think its just a data type issue, but not sure
b4 needs to have 2 significant figures; I'm not familiar with picaxe basics odd arithmetic syntax; if b4 was 100 * (b1/b2), then b4 could just be an integer, but will basic actually divide like this, and use a non integer value during its calculation?
Or would I be better with a different data type?
Thanks,
M21
Attachments
-
650 bytes Views: 9