Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
Help with Bit Operation
Robert
May 3 2009 12:07 AM
2.3k
Reply
Hello, assuming I have a value of n that is a power of 2, what is the quickest way to find which bit is set?
Is there anything faster than a simple iteration such as
int temp = 0;
for (int i = n; i > 1; i >>= 1, temp++) { }
Thanks
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
class library for numeric and alphabetic validation
Gridview bind without using database