Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Tagged as

Performance was not as expected

, 26 Jan 2013
Hi everyoneI wrote a function to get the exponent of a number power of two. Here is the code:int exp = 0;while((n = n / 2) > 0) {//while((n = n >> 1) > 0) { exp++;}return exp;Then came to mind, "Well, let's replace that division operator to the shift operator, to...

Revisions


  

Compare Revision Minor Date Status Editor
publicly available No 26-Jan-13 15:59 Available Filipe Marques
Updates in content. 813 changes had been made.
2 No 26-Jan-13 13:36 Available Filipe Marques
Updates in content. 376 changes had been made.
1 No 26-Jan-13 12:59 Available Filipe Marques

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Filipe Marques
Software Developer (Junior)
Portugal Portugal
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 26 Jan 2013
Article Copyright 2013 by Filipe Marques
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid