Skip to main content
GameDev.net gamedev.net
🔒 Locked

Binary to Decimal conversion - powers

Started by xeddiex Dec 2, 2005 at 7:56 PM 1 replies 700+ views
Original Post
xeddiex
xeddiex
I don't know how powers with negatives work so I need someone to explain to me how the two lines in bold below compute the results:

1*2^2   =  1*4    =    4.
1*2^1   =  1*2    =    2.
0*2^0   =  0*1    =    0.
1*2^-1  =  1*.5   =    0.5
1*2^-2  =  1*.25  =  + 0.25
                     -------
                       6.75
For example, I know 1*2^2 == 1 * (2 * 2) = 4; But I don't understand how the results are 1*.5 and 1 *.25 for the last two lines in the sample above. Thanks in advance, xeddiex
one..
SiCrane
SiCrane
Negative powers work by dividing by the absolute value of the power. For example 2-1 is equal 1/21 or .5. 2-2 is equal to 1/22 or .25.
xeddiex
xeddiex
Ah, simpler than I thought. Thanks alot SiCrane.


xeddiex
one..

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.