My PICAXE reads a sensor with readadc10, giving 0 to 1023 for 0 to 5 V, and I want the result in millivolts. The obvious w1 = w0 * 5000 / 1023 gives nonsense for most readings, and dividing first, w1 = w0 / 1023 * 5000, returns 0 for everything except full scale. I also noticed that w2 = 100 + w0 * 2 gives a different result from what I get on a calculator.
How are expressions evaluated in these small BASIC dialects, and how do I do this kind of scaling without floating point?




