Skip to main content
  • 3992 Accesses

8.7 Summary

The following are some practical rules and guidelines:

  • Learn the rules for the evaluation of arithmetic expressions.

  • Break expressions down where necessary to ensure that the expressions are evaluated in the way you want.

  • Take care with truncation owing to integer division in an expression. Note that this will only be a problem where both parts of the division are INTEGER.

  • Take care with truncation owing to the assignment statement when there is an integer on the left-hand side of the statement, i.e., assigning a real into an integer variable.

  • When you want to set up constants which will remain unchanged throughout the program, use the PARAMETER statement.

  • Do not confuse precision and accuracy.

  • Learn what the default KINDs are for the numeric types you work with, what the maximum and minimum values and precision are for REAL data, and what the maximum and minimum are for INTEGER data.

  • You have been introduced to the use of the functions DIGITS, HUGE and PRECISION, and some of the concepts involved in their use. We will look at functions in much greater depth later on.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 69.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

8.9 Bibliography

  • Froberg C.E., Introduction to Numerical Analysis, Addison-Wesley, 1969.

    Google Scholar 

  • IEEE, IEEE Standard for Binary Floating-Point Arithmetic, ANSI/IEEE Std 754–1985, Institute of Electrical and Electronic Engineers Inc.

    Google Scholar 

  • Knuth D., Seminumerical Algorithms, Addison-Wesley, 1969.

    Google Scholar 

  • Sun, Numerical Computation Guide, SunPro, 1993.

    Google Scholar 

  • Wakerly J.F., Microcomputer Architecture and Programming, Wiley, 1981.

    Google Scholar 

Download references

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag London Limited

About this chapter

Cite this chapter

(2006). Arithmetic. In: Introduction to Programming with Fortran. Springer, London. https://doi.org/10.1007/1-84628-054-0_8

Download citation

  • DOI: https://doi.org/10.1007/1-84628-054-0_8

  • Publisher Name: Springer, London

  • Print ISBN: 978-1-84628-053-5

  • Online ISBN: 978-1-84628-054-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics