|
-
March 19th, 2012, 09:10 AM
#1
need a simple integer pattern algorithm
Hello all,
In code, I need to transform these values:
256 becomes 0
128 becomes 1
64 becomes 2
32 becomes 3
16 becomes 4
8 becomes 5
4 becomes6
Is there some way to express this mathematically so that I do nto have to use a table lookup? I know this sounds like I am an idiot, but I can not figure out an obvious algorithm.
Regards,
Ellay K.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|