Raylin wrote:
Actually... that means that ASRPG could be optimized even more! o.o
And don't forget that with fixed-point packing, you could fit 99.99 and 99.99 together in a single floating-point number. Smile
o.o Fixed point packing?
Raylin wrote:
o.o Fixed point packing?
For example, say you have two numbers A and B. If you can guarantee that A and B are both always between 0.00 and 99.99, with no more than two decimal places (ie, they can be 84.39 but never 2.109 or 103.4), then you could pack, for example, 12.34 and 56.78 together like this:

12345678

The packing code is simple (in E6 and E2, "E" is the small-caps E), here I'm putting the packed value in C:


Code:
AE6+BE2->C


The unpacking code isn't much worse (assume the packed value is in C):


Code:
E{-}2(int(CE{-}4->A
E2fPart(CE{-}4->B
Ooh. That. Didn't know it was called that.
Raylin wrote:
Ooh. That. Didn't know it was called that.
Well, it's just packing in general; the fact that you're trying to pack in floating-point numbers means you need to call if fixed-point packing. It's fixed-point because you're dictating the exact number of decimal places, as is necessary to make the system consistent (for example, I'm sure you can see the problems if A is 10.001 and B is 80.00 - when you unpack A will be 10.00 and B will be 90.00).
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 3 of 3
» All times are UTC - 5 Hours
 
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

 

Advertisement