Click here to Skip to main content
13,048,846 members (68,647 online)
Click here to Skip to main content

Tagged as


Posted 26 Jan 2013

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...



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


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


About the Author

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

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170713.1 | Last Updated 26 Jan 2013
Article Copyright 2013 by Filipe Marques
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid