>> z = x*yz =0Herezshould have been2.5e-400, but due to exponent underﬂow, the result is displayed as 0.Due to the finite accuracy of the representation of numbers in a computer, errors can be madein computations.For example, we know that 1−5×0.2 = 0; however,Matlabproduces thefollowing:>> 1 -0.2 -0.2 -0.2 -0.2 -0.2ans =5.5511e-017The result is a very small number, but it is not exactly zero. The reason is that the binary numbercorresponding to 0.2 is0.001100110011001100. . .This representation requires an infinite number of digits. The consequence is that the computerworks with an approximate value of 0.2. Subtracting the approximate value of 0.2 from 1 five timesdoes not yield exactly 0.2.5Display OptionsThere are several ways to display the value of a variable. The simplest way is to enter the name of
This is the end of the preview.
access the rest of the document.