I have a 5 bit integer that I'm working with. Is there a native function in Objective-C that will let me know which bit is the leftmost?
i.e. I have 01001, it would return 8 or the position.
Thanks
You can build a lookup table, with 32 elements: 0, 1, 2, 2, 3, etc.
2.1m questions
2.1m answers
60 comments
57.0k users