Due Date
See the
calendar for due date.
Description:
Write a short Fortran program to calculate the sum of inverses of
i, for
i 1 to 10
9 (
i.e., 1x10
9) and the sum of the inverses of
i for
i 10
9 to 1 using both single precision (4 bytes) and double precision (8 bytes).
What are the results for each case:
- Single precision, forward sum
- Single precision, reverse sum
- Double precision, forward sum
- Double precision, reverse sum
Rubric:
Points Item
---------- --------------------------------------------------------------
_____ / 4 Fortran code
_____ / 4 Correct output
_____ / 2 Brief explanation
_____ / 10 Total
_____ Approximate number of hours spent
Submission
Submit the the results of each case and a brief description of the results into the appropriate folder in the dropbox for COMS 6100 at
https://elearn.mtsu.edu:
- Fortran source code
- Plain-text output of the program running (e.g., redirect the output of the program using ">")
- A brief explanation of the results
- Completed rubric (estimates for each line including hours spent)
Hints:
-
To use the correct kind values, use the following to define the kinds needed to work this problem:
! for the integer variables used in the counter
integer, parameter :: ikind = selected_int_kind(9)
! for the single precision real variable
integer, parameter :: sgle = selected_real_kind(6,37)
! for the double precision real variable
integer, parameter :: dble = selected_real_kind(15,307)
- Does your output (answers) make sense?