![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
King of Portal
|
Bitwise Operator Question
I looked in the documentation and searched around the forum, but there doesn't seem to be a function for circularly rotating (shifting) bits in a bitwise fashion. Wondering if anyone knows one of the top of their head or if there's something I overlooked in the manual? Thx for the help.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#2 |
|
King of Portal
|
Never mind it was on the php.net site but not in the manual. Someone was nice enough to post the function that they use
[PHP]function bitRotate32($value,$amount) { if ($amount>0) { $amount %= 32; $value = ($value<<$amount) | ($value>>(32-$amount)); } elseif ($amount<0) { $amount = -$amount%32; $value = ($value>>$amount) | ($value<<(32-$amount)); } return $value; }[/PHP]
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| bitwise operators and type double | ionexchange | C++ | 14 | Feb 12th, 2006 9:27 AM |
| need help with bitwise operations | metsfan | C | 17 | Feb 2nd, 2006 6:09 PM |
| The term "bitwise?" | Josef_Stalin | C++ | 3 | May 1st, 2005 9:55 PM |