summaryrefslogtreecommitdiff
path: root/243/CH4/EX4.1
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.1
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.1')
-rwxr-xr-x243/CH4/EX4.1/4_01.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/243/CH4/EX4.1/4_01.sce b/243/CH4/EX4.1/4_01.sce
new file mode 100755
index 000000000..7805fea38
--- /dev/null
+++ b/243/CH4/EX4.1/4_01.sce
@@ -0,0 +1,22 @@
+//Example No. 4_01
+//Greatest precision
+//Pg No. 63
+clear ; close ; clc ;
+
+a = '4.3201'
+b = '4.32'
+c = '4.320106'
+na = length(a)-strindex(a,'.')
+mprintf('\n %s has a precision of 10^-%i\n',a,na)
+nb = length(b)-strindex(b,'.')
+mprintf('\n %s has a precision of 10^-%i\n',b,nb)
+nc = length(c)-strindex(c,'.')
+mprintf('\n %s has a precision of 10^-%i\n',c,nc)
+[n,e] = max(na,nb,nc)
+if e ==1 then
+ mprintf('\n The number with highest precision is %s\n',a)
+elseif e == 2
+ mprintf('\n The number with highest precision is %s\n',b)
+else
+ mprintf('\n The number with highest precision is %s\n',c)
+end