From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 243/CH4/EX4.12/4_12.sce | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 243/CH4/EX4.12/4_12.sce (limited to '243/CH4/EX4.12') 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 -- cgit