Question: Write a program that tries to solve the following problem by adding up the terms. This equation diverges in real life. However, it does not

Write a program that tries to solve the following problem by adding up the terms.

Write a program that tries to solve the following problem by adding

This equation diverges in real life. However, it does not do this on a computer. There are three possibilities, 1) The sum overflows as it progresses, 2) 1 underflows and becomes 0 (There is a smallest nonzero number representable in a variable of type real), 3) The partial sum ceases to increase because of a lack of precision.

Q: First, guess which of the above possibilities will occur and write down your guess. No points off for wrong guesses.

Q: Second, write a Fortran program that computes this sum. Use a variable for the sum of type real*4, not double precision. Use one of the conditional do loops to check if the sum is changing. This means you will have 1 to have a second variable to remember the value from the previous iteration. When the loop is done, print out the sum, the number of times the loop executed, and the last 1/i, each with labels.

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 Databases Questions!