Tutorial02 - T2-1City University of Hong Kong Electronic...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: T2-1City University of Hong Kong Electronic Engineering Semester B 2007-2008 EE3108 Engineering Analysis Tutorial 2 In this tutorial, we examine the manifestation of numerical errors in the real computations. Round-off errors and truncation errors are considered using the Matlab environment. I. Round-off errorsRecall from the lecture that the computer number line is discrete: All numbers from (2/1ε−) to (2/1ε+) are rounded to 1. We calculated that 161022.2−×=εfor the double-precision format. However, assuming that we do not know value of ε, we can still find it out by using the following algorithm. Using the above flowchart, please modify the following script file. Run the file and see if it gives the expected value of ε. %File: t0201 clear; epsilon=1; b=1+epsilon/2; %%%% % %%%% fprintf(['The epsilon for this machine is ' num2str(epsilon)]); EE 3108 Semster B 2007/2008 S C Chan Start ε := 1Does the computer think that b = 1?...
View Full Document

Page1 / 3

Tutorial02 - T2-1City University of Hong Kong Electronic...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online