Hi
Is there any way of dividing two 16bit integers, a and b (where a<b and b != 0) without recieving a floating point number but instead a fraction with a denominator of 2^16. Something similar to motorola's FDIV. I'm using an 18f6720. (i couldn't find anything on other posts but maybe i missed something...)
Thanks
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
Posted: Mon Apr 19, 2004 12:10 pm
x=a/b
is the same as
x*2^16=(a*2^16)/b
To do this you must perform 32 bit division. I don't know what it benifit's you but it will work.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum