Click here to Skip to main content
12,451,425 members (50,399 online)
Click here to Skip to main content

Tagged as

Stats

1.6K views
Posted

Performance was not as expected

, 26 Jan 2013 CPOL
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
3 - 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

You may also be interested in...

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