• Create Account

# Fixed point on the GBA...

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1Arek the Absolute  Members   -  Reputation: 350

Like
Likes
Like

Posted 08 April 2002 - 02:46 PM

Can someone explain how FIXED works in general? I''ve seen a few examples out there that use it (particularly Dovoto''s at the Pern Project) but I can''t quite figure out what''s going on. In case you''re not familiar with the term, it uses s32, or for that matter signed longs. I don''t quite get the hang of how you use it to apparently hold decimal numbers... And how you arrange the decimal part where it needs to go, etc.. If you can basically just explain it as a whole, or otherwise point me to something that does, it''d be much appreciated. -Arek the Absolute

### #2llyod  Members   -  Reputation: 122

Like
Likes
Like

Posted 08 April 2002 - 03:03 PM

Fixed Point Math tutorial

Check out The 2D Game Developer''s Resource
Everything''s in it''s right place.

### #3meh  Members   -  Reputation: 375

Like
Likes
Like

Posted 08 April 2002 - 10:40 PM

After reading that tutorial link I''ve got confused. The basic idea of fixed point notation is that the decimal place is in a fixed position! Using an integer number to store this is relatively easy...

  Normal:2^   7 6 5 4 3 2 1 0bits 1 1 1 1 1 1 1 1    unsigned is 256 signed is -1Fixed point:2^   3 2 1 0 -1 -2 -3 -4   bits 1 1 1 1  1  1  1  1  unsigned is 16.9375 signed is -1.9375note: please check the numbers as they may be wrong :>

Addition and subtraction work as normal. But by multiplication and division cause the decimal point to move position and you will need to make adjustments (via bit shifts) to counter this.

### #4 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 09 April 2002 - 02:19 AM

quote:
Original post by meh
After reading that tutorial link I''ve got confused. The basic idea of fixed point notation is that the decimal place is in a fixed position! Using an integer number to store this is relatively easy...

    Normal:2^   7 6 5 4 3 2 1 0bits 1 1 1 1 1 1 1 1    unsigned is 256 signed is -1Fixed point:2^   3 2 1 0 -1 -2 -3 -4   bits 1 1 1 1  1  1  1  1  unsigned is 16.9375 signed is -1.9375note: please check the numbers as they may be wrong :>

Addition and subtraction work as normal. But by multiplication and division cause the decimal point to move position and you will need to make adjustments (via bit shifts) to counter this.

That''s right. What are you confused about?

### #5meh  Members   -  Reputation: 375

Like
Likes
Like

Posted 09 April 2002 - 11:13 PM

Nothing, I just mean''t the tutorial that was linked to is confusing... prehaps not the best way of expressing it but still. :>

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS