Chaitanya Lakshmi
  • About Me
  • Job Duties
  • Knowledge Blog
  • Applications
  • Contact Us
    • Linked In
    • Facebook
  • About Me
  • Job Duties
  • Knowledge Blog
  • Applications
  • Contact Us
    • Linked In
    • Facebook

What is shift operator?

2/17/2012

0 Comments

 
The shift operations allow bits to be moved to the left or right in a word. There are three types of shift operations: logical, rotate and arithmetic.

http://www.cs.uaf.edu/~cs301/notes/Chapter5/node3.html

$a & $b    -  And        -  Bits that are set in both $a and $b are set.
$a | $b    -  Or (inclusive or)    -  Bits that are set in either $a or $b are set.
$a ^ $b    -  Xor (exclusive or)-  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")
0 Comments



Leave a Reply.

    Archives

    April 2012
    March 2012
    February 2012

    Categor

    All
    Ajax
    Api
    Cross Site Scripting
    Css
    Curl
    Design Patterns
    Drupal
    Exception Handling
    Htaccess
    Html
    Javascript
    Jquery
    Json
    Linux
    Mysql
    Oops
    Php
    Regular Expressions
    Web 2.0
    Webservices
    Wordpress
    Xhtml

    RSS Feed

Powered by Create your own unique website with customizable templates.