summaryrefslogtreecommitdiff
path: root/243/CH4/EX4.6
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.6
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.6')
-rwxr-xr-x243/CH4/EX4.6/4_06.sce17
1 files changed, 17 insertions, 0 deletions
diff --git a/243/CH4/EX4.6/4_06.sce b/243/CH4/EX4.6/4_06.sce
new file mode 100755
index 000000000..25e84871f
--- /dev/null
+++ b/243/CH4/EX4.6/4_06.sce
@@ -0,0 +1,17 @@
+//Example No. 4_06
+//Truncation Error
+//Pg No. 68
+clear ; close ; clc ;
+
+x = -1/5
+//When first three terms are used
+Trunc_err = x^3/factorial(3) + x^4/factorial(4) + x^5/factorial(5) + x^6/factorial(6)
+mprintf('\n a) When first three terms are used \n Truncation error = %.6E \n ',Trunc_err)
+
+//When four terms are used
+Trunc_err = x^4/factorial(4) + x^5/factorial(5) + x^6/factorial(6)
+mprintf('\n b) When first four terms are used \n Truncation error = %.6E \n ',Trunc_err)
+
+//When Five terms are used
+Trunc_err = x^5/factorial(5) + x^6/factorial(6)
+mprintf('\n c) When first five terms are used \n Truncation error = %.6E \n ',Trunc_err) \ No newline at end of file