Jump to content
  • Advertisement

Archived

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

jemts

Bit shifts or multiplications

This topic is 5431 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 was wondering whether using bit shifts instead of multiplying or dividing by the power of 2^n is worth it. Will it improve performance at all and if so will it improve it enough to make using bit shift for this purpose worth wild. ---- Jemts "A Hooloovoo is a super-intelligent shade of the color blue."- Douglas Adams

Share this post


Link to post
Share on other sites
Advertisement
You will not notice a difference, and if the compiler is even half-smart it should do the conversion for you.

Share this post


Link to post
Share on other sites
Yeah, any compiler will convert a multiplication that is a power of 2 and turn it into a shift anyways, find something better to optimize .

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!