diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /2825/CH19/EX19.5/Ex19_5.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '2825/CH19/EX19.5/Ex19_5.sce')
-rwxr-xr-x | 2825/CH19/EX19.5/Ex19_5.sce | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/2825/CH19/EX19.5/Ex19_5.sce b/2825/CH19/EX19.5/Ex19_5.sce new file mode 100755 index 000000000..670e3e987 --- /dev/null +++ b/2825/CH19/EX19.5/Ex19_5.sce @@ -0,0 +1,15 @@ +//Ex19_5 Pg-958
+clc
+
+//Integer part
+bin='10101'; //binary input
+dec_I=bin2dec(bin) //decimal output
+
+//Decimal part
+a=1
+b=0
+c=1
+dec_D=a*2^(-1)+b*2^(-2)+c*2^(-3)
+dec=dec_I+dec_D //decimal output
+disp("The decimal equivqlent of 10101.101 is")
+disp(dec)
|