Jump to content
  • Advertisement
Sign in to follow this  
xeddiex

Binary to Decimal conversion - powers

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!