lep42 / libfixmath

Automatically exported from code.google.com/p/libfixmath
0 stars 0 forks source link

div defect #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am currently using libfixmath in android development.
with FIXMATH_NO_64BIT turned on, when calculating 1587 / 2000, it gives 0xcb2, 
but the correct result should be 0xcb23.
is there a error in fix16_div function ?

Original issue reported on code.google.com by silwi...@gmail.com on 10 Jun 2011 at 11:50

GoogleCodeExporter commented 8 years ago
Looks like fix16_div with FIXMATH_NO_64BIT has an error.  I was able to 
replicate the same issue.

Using the latest "standard" library
Answer = 0xcb23

Using the latest library with FIXMATH_NO_64BIT 
Answer = 0xcb2

I dont have time to look into it now.  Most likely later today.
1587/2001 = 0xCB09 
1587/1999 = 0xCB3D
1586/2000 = 0x1960
1588/2000 = 0x32d1

Original comment by joe.scha...@gmail.com on 10 Jun 2011 at 12:27

GoogleCodeExporter commented 8 years ago
Well looks like Vincent fixed my stupid mistake, so I'll close this issue. I 
should really get around to adding Henrys fast divide implementation but I'm 
struggling for time at the moment.

Original comment by Flatmush@googlemail.com on 10 Jun 2011 at 2:07