16_pdfsam_2 - > z = x*y z= 0 Here z should have been...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
>> z = x*y z= 0 Here z should have been 2.5e-400 , but due to exponent underflow, the result is displayed as 0. Due to the fnite accuracy oF the representation oF numbers in a computer, errors can be made in computations. ±or example, we know that 1 5 × 0 . 2 = 0; however, Matlab produces the Following: >> 1 -0.2 -0.2 -0.2 -0.2 -0.2 ans = 5.5511e-017 The result is a very small number, but it is not exactly zero. The reason is that the binary number corresponding to 0.2 is 0 . 001100110011001100 ... This representation requires an infnite number oF digits. The consequence is that the computer works with an approximate value oF 0.2. Subtracting the approximate value oF 0.2 From 1 fve times does not yield exactly 0. 2.5 Display Options There are several ways to display the value oF a variable. The simplest way is to enter the name oF
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/07/2010 for the course ENG 101 taught by Professor Chang during the Summer '09 term at 東京国際大学.

Ask a homework question - tutors are online