[AD] [ alleg-Bugs-1650580 ] Problem in fixed point library.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Bugs item #1650580, was opened at 2007-02-02 13:15
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=1650580&group_id=5665

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core Library
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: mans (snam_34)
Assigned to: Nobody/Anonymous (nobody)
Summary: Problem in fixed point library.

Initial Comment:
Hello,
    I am interested to use fixed point section of library and I found a mistake in it:

if you look for fixdiv which is fixed division, it is implimented using floating point division: Here is the code:

AL_INLINE(fixed, fixdiv, (fixed x, fixed y),
{
   if (y == 0) {
      *allegro_errno = ERANGE;
      return (x < 0) ? -0x7FFFFFFF : 0x7FFFFFFF;
   }
   else
      return ftofix(fixtof(x) / fixtof(y));
})

as you can see after, checking for range, X and Y converted to floating points and divided in that way. This is in contrast of using fixed arithmatics.

I think we need to extend this so it uses fixed point arithmatic instead of floating point.

Regards
ps: Is there any other fixed point library that I can look and possible use?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=1650580&group_id=5665




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/