summaryrefslogtreecommitdiff
path: root/243/CH4/EX4.12
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /243/CH4/EX4.12
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '243/CH4/EX4.12')
-rwxr-xr-x243/CH4/EX4.12/4_12.sce36
1 files changed, 36 insertions, 0 deletions
diff --git a/243/CH4/EX4.12/4_12.sce b/243/CH4/EX4.12/4_12.sce
new file mode 100755
index 000000000..3c2c127c3
--- /dev/null
+++ b/243/CH4/EX4.12/4_12.sce
@@ -0,0 +1,36 @@
+//Example No. 4_12
+//Addition of chain Numbers
+//Pg No. 77
+clear ; close ; clc ;
+
+x = 9678 ;
+y = 678 ;
+z = 78 ;
+d = 4 ; //length of mantissa
+n = max(length( string(y) ) , length(string(z)))
+fy = y/10^n
+fz = z/10^n
+fu = fy + fz
+Eu = n
+if fu >= 1 then
+ fu = fu/10
+ Eu = Eu + 1
+end
+u = fu * 10^Eu
+n = max(length( string(x) ) , length(string(u)))
+fu = u/10^4
+fx = x/10^4
+fw = fu + fx
+Ew = 4
+if fw >= 1 then
+ fw = fw/10
+ Ew = Ew + 1
+end
+//since length of mantissa is only four we need to maintain only four places in decimal, so
+fw = floor(fw*10^4)/10^4
+w = fw*10^Ew
+disp(w,'w = ')
+True_w = 10444
+ew = True_w - w
+er_w = (True_w - w)/True_w
+disp(er_w,'er,w = ',ew,'ew = ',True_w,'True w = ') \ No newline at end of file