summaryrefslogtreecommitdiff
path: root/Programming_in_C/Chapter_12.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Programming_in_C/Chapter_12.ipynb')
-rw-r--r--Programming_in_C/Chapter_12.ipynb19
1 files changed, 0 insertions, 19 deletions
diff --git a/Programming_in_C/Chapter_12.ipynb b/Programming_in_C/Chapter_12.ipynb
index 7f498638..a19ac40d 100644
--- a/Programming_in_C/Chapter_12.ipynb
+++ b/Programming_in_C/Chapter_12.ipynb
@@ -27,10 +27,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#12.1.py\n",
- "#The bitwise AND operator\n",
"\n",
- "#Main()\n",
"def main():\n",
"\n",
" #Variable Declaration\n",
@@ -44,7 +41,6 @@
" print(word1&word2&word3)\n",
" print(word1&1)\n",
"\n",
- "#Setting top level conditioanl script\n",
"if __name__=='__main__':\n",
" main()"
],
@@ -76,10 +72,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#12.2.py\n",
- "#Illustrate Bitwise Opertors\n",
"\n",
- "#Main()\n",
"def main():\n",
"\n",
" #variable Declarations\n",
@@ -100,7 +93,6 @@
" print(\"w1={0:3} w2={1:3}\".format(w1,w2))\n",
"\n",
"\n",
- "#Setting top level conditional script\n",
"if __name__=='__main__':\n",
" main()"
],
@@ -134,10 +126,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#12.3.py\n",
- "#Implementing a Shift Function\n",
"\n",
- "#Function to perform bitwise shift\n",
"def shift(value,n):\n",
" if(n>0):\n",
" value <<=n #Left shift\n",
@@ -146,7 +135,6 @@
"\n",
" return value\n",
"\n",
- "#Main()\n",
"def main():\n",
" #Variable Declaration\n",
" w1=177777\n",
@@ -158,7 +146,6 @@
" print(\"{0:7} {1:7}\".format(shift(w2,0),w2>>0))\n",
" print(\"{0:7} \".format(shift(shift(w1,-3),3)))\n",
"\n",
- "#Setting top level conditional script\n",
"if __name__=='__main__':\n",
" main()"
],
@@ -190,10 +177,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "#12.4.py\n",
- "#Implementing a Rotate Function\n",
"\n",
- "#Function to perform rotation\n",
"def rotate(value,n):\n",
"\n",
" #Calculation\n",
@@ -215,9 +199,7 @@
" return result\n",
"\n",
"\n",
- "#Main()\n",
"def main():\n",
- "#Variable Declaration\n",
" w1=0xabcdef00\n",
" w2=0xffff1122\n",
"\n",
@@ -229,7 +211,6 @@
" print(\"%x\"%rotate(w1,44))\n",
" \n",
"\n",
- "#Setting top level conditional script\n",
"if __name__=='__main__':\n",
" main()"
],