Your constant is 0.002421875... that's 10 significant figures... far too many for 16-bit math to cope with...

You've got the 0.002421875 value by taking your 2.48 VRef and dividing it by your 1024 bit resolution...

Let's forget all decimal places... and just stick to significant digits...

So now we have 2421875... that's down to 7 significant figures, but if you multiply this constant of yours by eight... you get 19375... five significant figures and an easy word variable to boot...

671 * 0.002421875 = 1.625078125

If now you take 671 and multiply it by our new constant of 19375 you get...

671 * 19375 = 13000625 (result)

But we are a factor of eight out... so use DIV32 to bring us back in line and simutaneously scale us back into the world of integers...

result / 800 = 16250 (a resultant easy 16-bit integer value).

so... by using this method, we end up with 1 and four decimal places (6250) which can be extracted with the DIG command.

At no time have we exceeded the limits for word integer math or the capabilities of PICBasic. Your best resolution with this method will be +/-0.0001 steps.

You can do a lot more math and get it better... but it's a first step on the path to enlightenment so to speak...

Melanie