Question: Type in the following code and run it: eps 1.0 while 1.0 1.0 + eps: print '.... eps - eps/2.0 print 'final eps:', eps

Type in the following code and run it: eps 1.0 while 1.0

  

Type in the following code and run it: eps 1.0 while 1.0 1.0 + eps: print '.... eps - eps/2.0 print 'final eps:', eps eps Explain with words what the code is doing, line by line. Then examine the output. How can it be that the "equation" 11+ eps is not true? Or in other words, that a number of approximately size 10-16 (the final eps value when the loop terminates) gives the same result as if eps were zero? Filename: machine_zero.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!