Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


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.

  • You cannot reply to this topic
4 replies to this topic

#1 Arek 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

Sponsor:

#2 llyod   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 April 2002 - 03:03 PM



Fixed Point Math tutorial

Also google for "fixed point math" if you need more info.



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


#3 meh   Members   -  Reputation: 379

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 0
bits 1 1 1 1 1 1 1 1 unsigned is 256 signed is -1

Fixed 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.9375

note: 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 0
bits 1 1 1 1 1 1 1 1 unsigned is 256 signed is -1

Fixed 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.9375

note: 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?

#5 meh   Members   -  Reputation: 379

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