Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
Help with Bit Operation
Robert
15y
2.3k
1
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
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
class library for numeric and alphabetic validation
Gridview bind without using database