Quote:
Originally Posted by
keymuu
The question is still how to calculate R
R = (L/2)*(L/2)/H/1000
when for ex. L= 350123 and H=37234 (in reality L=350,123 and H=37,234)
How could one split (divide, using DIV32 R0,R2 etc) to get PBP calculate the correct answer?
(L/2)*(L/2)The result of that alone is over 30 Billion.
/HDIV32 is actually a DIV31/15. The maximum divisor for DIV32 is 15-bits or 32767
37234 is too much.
/1000There's at least 3 decimals of precision you won't need, so why are the numbers so big to begin with? (rhetorical question)
<hr />
Let me open a whole new "Can of Worms", and suggest that you use the Microchip Floating Point Math module.
http://www.melabs.com/resources/fp.htm
It'll handle your numbers.
It takes a little getting used to, but it works.
<br>