Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 13th, 2006, 1:29 AM   #1
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 419
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
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
grimpirate is offline   Reply With Quote
Old Nov 13th, 2006, 2:39 AM   #2
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 419
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
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
grimpirate is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:46 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC