I found a code snippet in a book that reads like this:
for($string_size=1<<6; $string_size<=26176; $string_size+=1<<9)
{ ... }
And I had never seen << before.
http://www.php.net/manual/en/language.operators.bitwise.php
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================
>
> http://www.php.net/manual/en/language.operators.bitwise.php
Thanks, Jerry. What is this operator typically called? Actually, I
guess what I'm asking is, is there a common coding term for a '>>'
operator, and is its operation in php called bit-shifting?
$a & $b And Bits that are set in both $a and $b are set.
$a | $b Or Bits that are set in either $a or $b are set.
$a ^ $b Xor Bits that are set in $a or $b but not both are set.
~ $a Not Bits that are set in $a are not set, and vice versa.
$a << $b Shift left Shift the bits of $a $b steps to the left (each step
means "multiply by two")
$a >> $b Shift right Shift the bits of $a $b steps to the right (each step
means "divide by two")
--
//Aho
>$a >> $b Shift right Shift the bits of $a $b steps to the right
> (each step means "divide by two")
Not quite. Divide by two _and discard any remainder_.
E.g. even though seven divided by four is 1.75, 7 >> 2 = 1
I think the "" was there to strengthen that the divided by two wasn't entirely
true. It's not my words, just copy'n'paste from the manual.
--
//Aho
Just want to make sure that the OP doesn't come away with any mistaken
impressions, like supposing that 7 >> 2 and 7.0 / 4.0 might produce the same
result.