#### Archived

This topic is now archived and is closed to further replies.

# General Questions

This topic is 6773 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

##### Share on other sites
1. Floating Point
Ok, in decimal you represent numbers like:
AB.CD
A is the tens place
B is the ones place
C is the tenths place
and D is the hundreths place
In binary
A would be the twos place
B would be the ones place
C would be the halves place
and D is the quarters place

Numbers past the decimal are sucessively one half the one before.
So .11 is 1/2 + 1/4 or .75
.101 is 1/2 + 0/4 + 1/8 or 5/8.

Now we''ve got numbers like 10111.111.
That equivalent to 1.0111111 * 2^4.
Or .0010101 is 1.0101 * 2^-3.
So instead of storing 10111.111 it stores 1.0111111 and 4
And instead of storing .0010101 it stores 1.0101 and -3
But the first number is always 1 In this representation so we only need to store .0111111 and 4 or .0101 and -3

In the IEEE single precision floating point format the first bit is a sign bit, the next 23 bits are the precision bits and the last 8 bits are the exponent. Actually stored is the exponent plus 128 (or is it 127?).

2. #pragma
#pragma is used to twiddle with compiler specific compiling settings. (like byte alignment) You''d really have to see your compiler help docs for more help.

3. Data alignment
When data is aligned by 4 bytes, it basically means that it''s addressed is divisible by 4. Similar for 16. Some operations are more efficient when they are properly aligned.

4.
Not much.

5.
Generally it''s better to go with pre-existing algorithms if you aren''t in research. (i.e. just trying to put together a game vs. trying to put together a revolutionary game)

6.
Can''t really recommend any good sources.

1. 1
Rutin
47
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632993
• Total Posts
3009759
• ### Who's Online (See full list)

There are no registered users currently online

×