Quote Originally Posted by geckogrotto View Post
Ok thanks,
I just didn't want to go down that road if there was a better way,
Well, you could use the floating point math routines on melabs website, microchip's site, etc.etc. or write your own.

The trick to doing it the way you've got set up above is to make sure that no individual variables overflow or underflow, no matter what values end up going into them. It just takes a bit of thinking thru it all...