To whom it may concern,
I am trying to translate a measurement of inches to feet and inches. For instance if I am trying to convert 71 inches, it will be 5 feet 11 inches.
Let W0 = 71
W1 = W0 / 12 ‘ (This operation would give only the integer of the division, 5)
W2 = W0 // 12 *12 ‘ ( This operation gives as result 11 inches: 0.97 decimals multiplied by 12)
Nevertheless, when I try to do this arithmetic operation with the Picaxe 28X1, I get a lot of error, some times I get 5 feet 10 inches, some times 6 feet 0 inches. The microprocessor does not allow making simple operation just like a calculator where I just divide and get decimals multiply and so fort. Do you have any trick how to do this type of operations?
Thanks in advance
I am trying to translate a measurement of inches to feet and inches. For instance if I am trying to convert 71 inches, it will be 5 feet 11 inches.
Let W0 = 71
W1 = W0 / 12 ‘ (This operation would give only the integer of the division, 5)
W2 = W0 // 12 *12 ‘ ( This operation gives as result 11 inches: 0.97 decimals multiplied by 12)
Nevertheless, when I try to do this arithmetic operation with the Picaxe 28X1, I get a lot of error, some times I get 5 feet 10 inches, some times 6 feet 0 inches. The microprocessor does not allow making simple operation just like a calculator where I just divide and get decimals multiply and so fort. Do you have any trick how to do this type of operations?
Thanks in advance