<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=JavaScript_Tutorial%2FOperators%2FBitwise_Operator</id>
		<title>JavaScript Tutorial/Operators/Bitwise Operator - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=JavaScript_Tutorial%2FOperators%2FBitwise_Operator"/>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_Tutorial/Operators/Bitwise_Operator&amp;action=history"/>
		<updated>2026-04-04T11:31:42Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wbex.ru/index.php?title=JavaScript_Tutorial/Operators/Bitwise_Operator&amp;diff=9155&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_Tutorial/Operators/Bitwise_Operator&amp;diff=9155&amp;oldid=prev"/>
				<updated>2010-05-26T08:24:51Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 08:24, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://wbex.ru/index.php?title=JavaScript_Tutorial/Operators/Bitwise_Operator&amp;diff=9154&amp;oldid=prev</id>
		<title> в 18:52, 25 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_Tutorial/Operators/Bitwise_Operator&amp;diff=9154&amp;oldid=prev"/>
				<updated>2010-05-25T18:52:56Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Bitwise AND Truth Table==&lt;br /&gt;
&lt;br /&gt;
First Value&lt;br /&gt;
Second Value&lt;br /&gt;
Result&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
&lt;br /&gt;
== ^= (Bitwise Exclusive OR Assignment)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
Syntax    variable ^= value&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&amp;lt;p&amp;gt;Bitwise Exclusive OR Truth Table&amp;lt;/p&amp;gt;&lt;br /&gt;
First Value&lt;br /&gt;
Second Value&lt;br /&gt;
Result&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
&lt;br /&gt;
== Bitwise Exclusive OR Truth Table==&lt;br /&gt;
&lt;br /&gt;
First Value&lt;br /&gt;
Second Value&lt;br /&gt;
Result&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var iResult = 25 | 3;&lt;br /&gt;
alert(iResult);    //outputs &amp;quot;27&amp;quot;&lt;br /&gt;
25 = 0000 0000 0000 0000 0000 0000 0001 1001&lt;br /&gt;
 3 = 0000 0000 0000 0000 0000 0000 0000 0011&lt;br /&gt;
--------------------------------------------&lt;br /&gt;
OR = 0000 0000 0000 0000 0000 0000 0001 1011&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== ~ (Bitwise NOT)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The bitwise NOT is represented by a tilde (~).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The bitwise NOT is a three-step process:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;The operand is converted to a 32-bit number.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;The binary form is converted into its one&amp;quot;s complement.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;The one&amp;quot;s complement is converted back to a floating-point number.&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var iNum1 = 25;        //25 is equal to 00000000000000000000000000011001&lt;br /&gt;
var iNum2 = ~iNum1;    //convert to 111111111111111111111111111100110&lt;br /&gt;
alert(iNum2);          //outputs &amp;quot;-26&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Bitwise Operators==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Bitwise operators in JavaScript only work with integers that are 32 bits in length.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;Bitwise AND&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Bitwise OR&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Bitwise XOR (exclusive OR)&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Bitwise NOT&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Shift Left (&amp;lt;&amp;lt;)&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Shift Right with Sign(&amp;gt;&amp;gt;)&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;Shift Right Zero Fill(&amp;gt;&amp;gt;&amp;gt;)&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
2. 5. Bitwise Operator&lt;br /&gt;
2. 5. 1. &lt;br /&gt;
Bitwise Operators&lt;br /&gt;
2. 5. 2. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/BitwiseANDTruthTable.htm&amp;quot;&amp;gt;Bitwise AND Truth Table&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 3. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/UsingtheBitwiseANDOperator.htm&amp;quot;&amp;gt;Using the Bitwise AND Operator&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 4. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/UsingtheBitwiseANDPlusAssignmentOperator.htm&amp;quot;&amp;gt;Using the Bitwise AND Plus Assignment Operator&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 5. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/BitwiseExclusiveORTruthTable.htm&amp;quot;&amp;gt;Bitwise Exclusive OR Truth Table&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 6. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/UsingtheBitwiseExclusiveOROperator.htm&amp;quot;&amp;gt;Using the Bitwise Exclusive OR Operator&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 7. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/UsingtheBitwiseExclusiveOROperator2.htm&amp;quot;&amp;gt;Using the Bitwise Exclusive OR Operator (2)&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 8. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/BitwiseORAssignment.htm&amp;quot;&amp;gt;|= (Bitwise OR Assignment)&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 9. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/BitwiseExclusiveORAssignment.htm&amp;quot;&amp;gt;^= (Bitwise Exclusive OR Assignment)&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 10. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/UsingBitwiseExclusiveORPlusAssignmentOperator.htm&amp;quot;&amp;gt;Using Bitwise Exclusive OR Plus Assignment Operator&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 11. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/BitwiseOR.htm&amp;quot;&amp;gt;| (Bitwise OR)&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 12. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/BitwiseNOT.htm&amp;quot;&amp;gt;~ (Bitwise NOT)&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 13. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/ShiftLeft.htm&amp;quot;&amp;gt;&amp;lt;&amp;lt; (Shift Left)&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 14. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/ShiftLeftAssignment.htm&amp;quot;&amp;gt;&amp;lt;&amp;lt;= (Shift Left Assignment)&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 15. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/LessThanorEqual.htm&amp;quot;&amp;gt;&amp;lt;= (Less Than or Equal)&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 16. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/ShiftRightwithSign.htm&amp;quot;&amp;gt;&amp;gt;&amp;gt; (Shift Right with Sign)&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 17. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/ShiftRightwithSignAssignment.htm&amp;quot;&amp;gt;&amp;gt;&amp;gt;= (Shift Right with Sign Assignment)&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 18. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/ShiftRightZeroFill.htm&amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt; (Shift Right Zero Fill)&amp;lt;/a&amp;gt;&lt;br /&gt;
2. 5. 19. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Tutorial/JavaScript/0040__Operators/ShiftRightZeroFillAssignment.htm&amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;= (Shift Right Zero Fill Assignment)&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== | (Bitwise OR)==&lt;br /&gt;
&lt;br /&gt;
Syntax&lt;br /&gt;
num1 | num2&lt;br /&gt;
&amp;lt;p&amp;gt;Bitwise Exclusive OR Truth Table&amp;lt;/p&amp;gt;&lt;br /&gt;
First Value&lt;br /&gt;
Second Value&lt;br /&gt;
Result&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
&lt;br /&gt;
== |= (Bitwise OR Assignment)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    // 2 = 00000000000000000000000000000011&lt;br /&gt;
    // 5 = 00000000000000000000000000000101&lt;br /&gt;
    // 7 = 00000000000000000000000000000111&lt;br /&gt;
    x = 2;&lt;br /&gt;
    x |= 5;&lt;br /&gt;
    document.write(&amp;quot;x = &amp;quot;,x);&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    str = new String(&amp;quot;34&amp;quot;);&lt;br /&gt;
    if(str &amp;lt;= 77)&lt;br /&gt;
      document.write(&amp;quot;34 is less than or equal to 77&amp;quot;);&lt;br /&gt;
    else&lt;br /&gt;
      document.write(&amp;quot;Returned FALSE!&amp;quot;);&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The shift left operator looks at the integer to the left of the operator as a 32-bit binary number.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The number of positions specified by num2 shifts all the bits of num1 to the left.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As the bits are shifted to the left, zeros are filled in on the right.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Because the number can only be 32-bits long, the extra bits on the left are lost.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The 32-bit binary result of the shifting operation is converted to an integer value and returned from the shift left operation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The result generated from the shift left operator can be quickly calculated by multiplying the number by 2 raised to the x power, where x is the number of positions shifted.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    // 2 = 00000000000000000000000000000010&lt;br /&gt;
    // 8 = 00000000000000000000000000001000&lt;br /&gt;
    x = 2 &amp;lt;&amp;lt; 2;&lt;br /&gt;
    document.write(&amp;quot;2 &amp;lt;&amp;lt; 2 = &amp;quot;,x);&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The shift left operator looks at the integer stored in the variable to the left of the operator as a 32-bit binary number.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;All the bits in this number are shifted to the left by the number of positions specified by the integer to the right of the operator.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As the bits are shifted to the left, zeros are filled in on the right.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The extra bits on the left are lost.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The 32-bit binary result of shifting operation is converted to an integer value and stored in the variable to the left of the operator.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    //  3 = 00000000000000000000000000000011&lt;br /&gt;
    // 12 = 00000000000000000000000000001100&lt;br /&gt;
    x = 3;&lt;br /&gt;
    x &amp;lt;&amp;lt;= 2;&lt;br /&gt;
    document.write(&amp;quot;x = &amp;quot;,x);&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== &amp;gt;&amp;gt; (Shift Right with Sign)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The shift right with sign operator looks at the integer to the left of the operator, num1, as a 32-bit binary number.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;All the bits in this number are shifted to the right by the number of positions specified by num2.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the original number is positive, zeros are added to the left side of the binary number.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the original number is negative, ones are used.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The extra bits on the right are lost.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The 32-bit binary result of shifting operation is converted to an integer value and returned from the shift right with sign operation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The result generated from the shift right with sign operator can be quickly calculated by dividing the number by 2 raised to the x power, where x is the number of positions shifted. Discard the remainder.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    // 14 = 00000000000000000000000000001110&lt;br /&gt;
    //  3 = 00000000000000000000000000000011&lt;br /&gt;
    x = 14 &amp;gt;&amp;gt; 2;&lt;br /&gt;
    document.write(&amp;quot;14 &amp;gt;&amp;gt; 2 = &amp;quot;,x);&lt;br /&gt;
    document.write(&amp;quot;&amp;lt;br&amp;gt;&amp;quot;);&lt;br /&gt;
    // -4 = 11111111111111111111111111111100&lt;br /&gt;
    // -2 = 11111111111111111111111111111110&lt;br /&gt;
    y = -4 &amp;gt;&amp;gt; 1;    //y is equal to -2&lt;br /&gt;
    document.write(&amp;quot;-4 &amp;gt;&amp;gt; 2 = &amp;quot;,y);&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== &amp;gt;&amp;gt;= (Shift Right with Sign Assignment)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The shift right with sign and assignment operator looks at the integer to the left of the operator as a 32-bit binary number.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;All the bits in this number are shifted to the right by the number of positions specified by the integer to the right of the operator.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the original number is positive, zeros are added to the left side of the binary number.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the original number is negative, ones are used.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Because the result can only be 32-bits long, the extra bits on the right are lost.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The 32-bit binary result of shifting operation is converted to an integer value and stored in the variable to the left of the operator.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    // 15 = 00000000000000000000000000001111&lt;br /&gt;
    //  7 = 00000000000000000000000000000111&lt;br /&gt;
    x = 15;&lt;br /&gt;
    x &amp;gt;&amp;gt;= 1;&lt;br /&gt;
    document.write(&amp;quot;x = &amp;quot;,x);&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== &amp;gt;&amp;gt;&amp;gt; (Shift Right Zero Fill)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The shift right zero fill operator looks at the integer to the left of the operator as a 32-bit binary number.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;All the bits in this number are shifted to the right by the number of positions specified by the integer to the right of the operator.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As the bits are shifted to the right, zeros are filled in on the left, regardless of the sign of the original integer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The extra bits on the right are lost.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The 32-bit binary result of this shifting operation is converted to an integer value and returned from the shift right zero fill operation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    // 13 = 00000000000000000000000000001101&lt;br /&gt;
    //  6 = 00000000000000000000000000000110&lt;br /&gt;
    x = 13 &amp;gt;&amp;gt;&amp;gt; 1;&lt;br /&gt;
    document.write(&amp;quot;13 &amp;gt;&amp;gt;&amp;gt; 1 = &amp;quot;,x);&lt;br /&gt;
&lt;br /&gt;
    document.write(&amp;quot;&amp;lt;br&amp;gt;&amp;quot;);&lt;br /&gt;
    //         -8 = 11111111111111111111111111111000&lt;br /&gt;
    // 1073741822 = 00111111111111111111111111111110&lt;br /&gt;
    y = -8 &amp;gt;&amp;gt;&amp;gt; 2;&lt;br /&gt;
    document.write(&amp;quot;-8 &amp;gt;&amp;gt;&amp;gt; 2 = &amp;quot;,y);&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== &amp;gt;&amp;gt;&amp;gt;= (Shift Right Zero Fill Assignment)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The shift right zero fill with assignment operator looks at the integer to the left of the operator as a 32-bit binary number.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;All the bits in this number are shifted to the right by the number of positions specified by the integer to the right of the operator.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As the bits are shifted to the right, zeros are filled in on the left, regardless of the sign of the original integer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The extra bits on the right are lost.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The 32-bit binary result of this shifting operation is converted to an integer value and stored in the variable to the left of the operator.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    //         -6 = 11111111111111111111111111111010&lt;br /&gt;
    // 1073741822 = 00111111111111111111111111111110&lt;br /&gt;
    x = -6;&lt;br /&gt;
    x &amp;gt;&amp;gt;&amp;gt;= 2;&lt;br /&gt;
    document.write(&amp;quot;x = &amp;quot;,x);&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Using Bitwise Exclusive OR Plus Assignment Operator==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    // integer = 32-bit binary representation&lt;br /&gt;
    // 10 = 00000000000000000000000000001010&lt;br /&gt;
    //  6 = 00000000000000000000000000000110&lt;br /&gt;
    // 12 = 00000000000000000000000000001100&lt;br /&gt;
    x = 10;&lt;br /&gt;
    x ^= 6;&lt;br /&gt;
    document.write(&amp;quot;x = &amp;quot;,x);&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Using the Bitwise AND Operator==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    // integer = 32-bit binary representation&lt;br /&gt;
    // 11 = 00000000000000000000000000001011&lt;br /&gt;
    //  6 = 00000000000000000000000000000110&lt;br /&gt;
    //  2 = 00000000000000000000000000000010&lt;br /&gt;
    answer = 11 &amp;amp; 6;&lt;br /&gt;
    document.write(&amp;quot;11 &amp;amp; 6 = &amp;quot;,answer);&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Using the Bitwise AND Plus Assignment Operator==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var iResult = 25 &amp;amp; 3;&lt;br /&gt;
alert(iResult);    //outputs &amp;quot;1&amp;quot;&lt;br /&gt;
 25 = 0000 0000 0000 0000 0000 0000 0001 1001&lt;br /&gt;
  3 = 0000 0000 0000 0000 0000 0000 0000 0011&lt;br /&gt;
---------------------------------------------&lt;br /&gt;
AND = 0000 0000 0000 0000 0000 0000 0000 0001&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Using the Bitwise Exclusive OR Operator==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var iResult = 25 ^ 3;&lt;br /&gt;
alert(iResult);    //outputs &amp;quot;26&amp;quot;&lt;br /&gt;
25 = 0000 0000 0000 0000 0000 0000 0001 1001&lt;br /&gt;
  2 = 0000 0000 0000 0000 0000 0000 0000 0011&lt;br /&gt;
---------------------------------------------&lt;br /&gt;
XOR = 0000 0000 0000 0000 0000 0000 0001 1010&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Using the Bitwise Exclusive OR Operator (2)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    // integer = 32-bit binary representation&lt;br /&gt;
    //  9 = 00000000000000000000000000001001&lt;br /&gt;
    //  5 = 00000000000000000000000000000101&lt;br /&gt;
    // 13 = 00000000000000000000000000001101&lt;br /&gt;
    document.write(&amp;quot;9 | 5 = &amp;quot;, (9 | 5) );&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>