You are here:

A Treatment of Computational Precision, Number Representation, and Large Integers in an Introductory Fortran Course
Article

, Francis Marion University, United States

JCMST Volume 25, Number 3, ISSN 0731-9258 Publisher: Association for the Advancement of Computing in Education (AACE), Waynesville, NC USA

Abstract

Computational precision is sometimes given short shrift in a first programming course. Treating this topic requires discussing integer and floating-point number representations and inaccuracies that may result from their use. An example of a moderately simple programming problem from elementary statistics was examined. It forced students to confront problems associated with number representations and investigate appropriate ways to circumvent them. In the example, integers were represented using two's complement form, and floating-point numbers according to the Institute of Electrical and Electronics Engineers (IEEE) standard 754, both using 32 bits. Floating-point number representation (64-bit) was necessary to achieve results accurate to two decimal positions. Finally, Fortran 90/95 subprograms were written to implement arbitrarily precise operations with large integers. Students in an introductory course can write subprograms for addition and subtraction of large integers. More sophisticated subprograms that depend on the fast Fourier transform were written to perform multiplication and division of large integers. These subprograms are more suited to an advanced programming or numerical analysis course. The subprograms written to perform large-integer operations were used to determine exact solutions for the statistical problem.

Citation

Richardson, W. (2006). A Treatment of Computational Precision, Number Representation, and Large Integers in an Introductory Fortran Course. Journal of Computers in Mathematics and Science Teaching, 25(3), 213-237. Waynesville, NC USA: Association for the Advancement of Computing in Education (AACE). Retrieved December 4, 2022 from .

Keywords

References

View References & Citations Map

These references have been extracted automatically and may have some errors. Signed in users can suggest corrections to these mistakes.

Suggest Corrections to References