Questions about this topic? Sign up to ask in the talk tab.

Difference between revisions of "Perl/Basics/Boolean Logic/Bitwise Manipulations/Bit Shifting"

From NetSec
Jump to: navigation, search
 
Line 1: Line 1:
 +
<noinclude><font size="-2">
 +
:'''[[Perl]] > [[Perl/Basics|Basics]] > [[Perl/Basics/Boolean Logic|Boolean Logic]] > [[Perl/Basics/Boolean Logic/Bitwise Manipulations|Bitwise Manipulations]] > Bit Shifting'''
 +
</font></noinclude>
 +
 
* '''<<''' - The '''shift left''' operator
 
* '''<<''' - The '''shift left''' operator
 
* '''>>''' - The '''shift right''' operator
 
* '''>>''' - The '''shift right''' operator

Latest revision as of 04:39, 22 October 2012

Perl > Basics > Boolean Logic > Bitwise Manipulations > Bit Shifting

  • << - The shift left operator
  • >> - The shift right operator

<syntaxhighlight lang="perl">my $num = 10; $num = $num << 2; #Shift left two bits $num = $num >> 2; #Shift right two bits print $num . "\n"; </syntaxhighlight>