---
title: "What every computer scientist should know about floating-point"
description: "Goldberg addresses a gap in computer science training. 34 references, cited by 41 papers here."
authors: ["David Goldberg"]
year: 1991
venue: "ACM Computing Surveys 23(1):5–48; reprinted by Sun/Oracle"
source: "https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html"
licence: "All rights reserved — free to read at the source"
summary_licence: "Elamur Cosmic License"
canonical: "https://research.elamur.ai/free/en/papers/goldberg-1991-what-every-computer-scientist-should/"
---
[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/goldberg-1991-what-every-computer-scientist-should/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [1991](https://md.research.elamur.ai/free/en/papers/1991/) / What every computer scientist should know about floating-point arithmetic

# What every computer scientist should know about floating-point arithmetic

**Authors:** David Goldberg · **Year:** 1991 · **Venue:** [ACM Computing Surveys 23(1):5–48; reprinted by Sun/Oracle](https://md.research.elamur.ai/free/en/venues/acm-computing-surveys/) ([ACM Computing Surveys 1991](https://md.research.elamur.ai/free/en/venues/acm-computing-surveys/1991/)) · **Publisher:** [Association for Computing Machinery](https://md.research.elamur.ai/free/en/publishers/association-for-computing-machinery/) · **Licence:** All rights reserved — free to read at the source

**Links:** [Publisher's page](https://doi.org/10.1145/103162.103163) · [PDF](https://docs.oracle.com/cd/E19957-01/800-7895/800-7895.pdf) · [OpenAlex](https://openalex.org/W2169004268)

**Citations:** 1,750 citations (OpenAlex, 2026-10-14) · [41](https://md.research.elamur.ai/free/en/papers/goldberg-1991-what-every-computer-scientist-should/cited-by/) in our library, of the 149,439 papers whose bibliographies we read

## Summary
Goldberg addresses a gap in computer science training. Floating-point arithmetic appears in almost every language, processor and operating system, yet system builders rarely get a rigorous account of how it behaves. The paper is a self-contained tutorial with proofs that rely only on elementary calculus. It has three parts. The first explains how real numbers are approximated with a base β and a precision p, and how rounding error is measured in ulps and relative error. It also shows why guard digits matter when nearly equal values cancel. The second part examines the IEEE floating-point standard, including its exactly rounded basic operations, special quantities such as NaN and infinity, denormalized numbers, and exceptions, flags and trap handlers. The third part links these ideas to instruction set design, compiler optimization and exception handling. The author's main argument is that floating-point behaviour can be analysed precisely, and that hardware and language support make reliable numerical software much easier to build.

## Key points
- Decimal 0.1 has no finite binary representation, so with β = 2 it always falls between two representable numbers. Values beyond the exponent limits (e_max, e_min) lead to overflow and underflow, which the paper handles through infinity and denormalized numbers.
- IBM considered guard digits important enough to add one to System/360 double precision in 1968. It also retrofitted machines already installed in the field.
- The IEEE standard specifies the results of addition, subtraction, multiplication, division and square root. Compliant machines therefore give bit-identical results for these operations, which simplifies porting.
- In naive summation, the error is bounded by roughly nε·Σ|x_j|. The Kahan summation formula (Theorem 8, with a proof drawn from Knuth 1981) achieves about a 2ε bound. IEEE double precision, where 1/ε ≈ 10^16, can do even better.
- Double rounding in binary–decimal conversion can be avoided by using the inexact flag together with round-to-zero. The tutorial grew out of W. Kahan's 1988 course at Sun Microsystems, which was organized by David Hough.

*Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.*

## Institutions

- [Palo Alto Research Center](https://md.research.elamur.ai/free/en/labs/palo-alto-research-center/) — Research institute, Palo Alto, United States · 15 works · 9,914 citations

📚 Shelves (5): [🖥️ Computer Science](https://md.research.elamur.ai/free/en/shelves/computer-science/) · 18,614 works · [🤖 Artificial Intelligence](https://md.research.elamur.ai/free/en/shelves/computer-science/artificial-intelligence/) · 17,965 works · [🧮 Computational Theory and Mathematics](https://md.research.elamur.ai/free/en/shelves/computer-science/computational-theory-and-mathematics/) · 321 works · [⚙️ Engineering](https://md.research.elamur.ai/free/en/shelves/engineering/) · 188 works · [⚙️ Electrical and Electronic Engineering](https://md.research.elamur.ai/free/en/shelves/engineering/electrical-and-electronic-engineering/) · 33 works

## Cite

Cite as: David Goldberg. 1991. What every computer scientist should know about floating-point arithmetic. ACM Computing Surveys 23(1):5–48; reprinted by Sun/Oracle.

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@inproceedings{goldberg1991what,
  title = {{What every computer scientist should know about floating-point arithmetic}},
  author = {David Goldberg},
  booktitle = {ACM Computing Surveys 23(1):5–48; reprinted by Sun/Oracle},
  year = {1991},
  doi = {10.1145/103162.103163},
  url = {https://doi.org/10.1145/103162.103163}
}
```

- [← previous Instance-Based Learning Algorithms](https://md.research.elamur.ai/free/en/papers/aha-1991-instance-based-learning-algorithms/)
- [next → Lexical Cohesion Computed by Thesaural relations as an indicator of the structure of text](https://md.research.elamur.ai/free/en/papers/morris-1991-lexical-cohesion-computed-thesaural-relations/)
- [↑ back to papers of 1991](https://md.research.elamur.ai/free/en/papers/1991/)

## References

34 references, 0 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

1. Aho, Alfred V., Sethi, R., and Ullman J. D. 1986. Compilers: Principles, Techniques and Tools, Addison-Wesley, Reading, MA. [find](https://scholar.google.com/scholar?q=Aho%2C+Alfred+V%2E%2C+Sethi%2C+R%2E%2C+and+Ullman+J%2E+D%2E+1986%2E+Compilers%3A+Principles%2C+Techniques+and+Tools%2C+Addison%2DWesley%2C+Reading%2C+MA%2E)
2. ANSI 1978. American National Standard Programming Language FORTRAN, ANSI Standard X3.9-1978, American National Standards Institute, New York, NY. [find](https://scholar.google.com/scholar?q=ANSI+1978%2E+American+National+Standard+Programming+Language+FORTRAN%2C+ANSI+Standard+X3%2E9%2D1978%2C+American+National+Standards+Institute%2C+New+York%2C+NY%2E)
3. Barnett, David 1987. A Portable Floating-Point Environment, unpublished manuscript. [find](https://scholar.google.com/scholar?q=Barnett%2C+David+1987%2E+A+Portable+Floating%2DPoint+Environment%2C+unpublished+manuscript%2E)
4. Brown, W. S. 1981. A Simple but Realistic Model of Floating-Point Computation, ACM Trans. on Math. Software 7(4), pp. 445-480. [find](https://scholar.google.com/scholar?q=Brown%2C+W%2E+S%2E+1981%2E+A+Simple+but+Realistic+Model+of+Floating%2DPoint+Computation%2C+ACM+Trans%2E+on+Math%2E+Software+7%284%29%2C+pp%2E+445%2D480%2E)
5. Cody, W. J et. al. 1984. A Proposed Radix- and Word-length-independent Standard for Floating-point Arithmetic, IEEE Micro 4(4), pp. 86-100. [find](https://scholar.google.com/scholar?q=Cody%2C+W%2E+J+et%2E+al%2E+1984%2E+A+Proposed+Radix%2D+and+Word%2Dlength%2Dindependent+Standard+for+Floating%2Dpoint+Arithmetic%2C+IEEE+Micro+4%284%29%2C+pp%2E+86%2D100%2E)
6. Cody, W. J. 1988. Floating-Point Standards — Theory and Practice, in “Reliability in Computing: the role of interval methods in scientific computing”, ed. by Ramon E. Moore, pp. 99-107, Academic Press, Boston, MA. [find](https://scholar.google.com/scholar?q=Cody%2C+W%2E+J%2E+1988%2E+Floating%2DPoint+Standards+%E2%80%94+Theory+and+Practice%2C+in+%E2%80%9CReliability+in+Computing%3A+the+role+of+interval+methods+in+scientific+computing%E2%80%9D%2C+ed%2E+by+Ramon+E%2E+Moore%2C+pp%2E+99%2D107%2C+Academic+Press)
7. Coonen, Jerome 1984. Contributions to a Proposed Standard for Binary Floating-Point Arithmetic, PhD Thesis, Univ. of California, Berkeley. [find](https://scholar.google.com/scholar?q=Coonen%2C+Jerome+1984%2E+Contributions+to+a+Proposed+Standard+for+Binary+Floating%2DPoint+Arithmetic%2C+PhD+Thesis%2C+Univ%2E+of+California%2C+Berkeley%2E)
8. Dekker, T. J. 1971. A Floating-Point Technique for Extending the Available Precision, Numer. Math. 18(3), pp. 224-242. [find](https://scholar.google.com/scholar?q=Dekker%2C+T%2E+J%2E+1971%2E+A+Floating%2DPoint+Technique+for+Extending+the+Available+Precision%2C+Numer%2E+Math%2E+18%283%29%2C+pp%2E+224%2D242%2E)
9. Demmel, James 1984. Underflow and the Reliability of Numerical Software, SIAM J. Sci. Stat. Comput. 5(4), pp. 887-919. [find](https://scholar.google.com/scholar?q=Demmel%2C+James+1984%2E+Underflow+and+the+Reliability+of+Numerical+Software%2C+SIAM+J%2E+Sci%2E+Stat%2E+Comput%2E+5%284%29%2C+pp%2E+887%2D919%2E)
10. Farnum, Charles 1988. Compiler Support for Floating-point Computation, Software-Practice and Experience, 18(7), pp. 701-709. [find](https://scholar.google.com/scholar?q=Farnum%2C+Charles+1988%2E+Compiler+Support+for+Floating%2Dpoint+Computation%2C+Software%2DPractice+and+Experience%2C+18%287%29%2C+pp%2E+701%2D709%2E)
11. Forsythe, G. E. and Moler, C. B. 1967. Computer Solution of Linear Algebraic Systems, Prentice-Hall, Englewood Cliffs, NJ. [find](https://scholar.google.com/scholar?q=Forsythe%2C+G%2E+E%2E+and+Moler%2C+C%2E+B%2E+1967%2E+Computer+Solution+of+Linear+Algebraic+Systems%2C+Prentice%2DHall%2C+Englewood+Cliffs%2C+NJ%2E)
12. Goldberg, I. Bennett 1967. 27 Bits Are Not Enough for 8-Digit Accuracy, Comm. of the ACM. 10(2), pp 105-106. [find](https://scholar.google.com/scholar?q=Goldberg%2C+I%2E+Bennett+1967%2E+27+Bits+Are+Not+Enough+for+8%2DDigit+Accuracy%2C+Comm%2E+of+the+ACM%2E+10%282%29%2C+pp+105%2D106%2E)
13. Goldberg, David 1990. Computer Arithmetic, in “Computer Architecture: A Quantitative Approach”, by David Patterson and John L. Hennessy, Appendix A, Morgan Kaufmann, Los Altos, CA. [find](https://scholar.google.com/scholar?q=Goldberg%2C+David+1990%2E+Computer+Arithmetic%2C+in+%E2%80%9CComputer+Architecture%3A+A+Quantitative+Approach%E2%80%9D%2C+by+David+Patterson+and+John+L%2E+Hennessy%2C+Appendix+A%2C+Morgan+Kaufmann%2C+Los+Altos%2C+CA%2E)
14. Golub, Gene H. and Van Loan, Charles F. 1989. Matrix Computations, 2nd edition,The Johns Hopkins University Press, Baltimore Maryland. [find](https://scholar.google.com/scholar?q=Golub%2C+Gene+H%2E+and+Van+Loan%2C+Charles+F%2E+1989%2E+Matrix+Computations%2C+2nd+edition%2CThe+Johns+Hopkins+University+Press%2C+Baltimore+Maryland%2E)
15. Graham, Ronald L. , Knuth, Donald E. and Patashnik, Oren. 1989. Concrete Mathematics, Addison-Wesley, Reading, MA, p.162. [find](https://scholar.google.com/scholar?q=Graham%2C+Ronald+L%2E+%2C+Knuth%2C+Donald+E%2E+and+Patashnik%2C+Oren%2E+1989%2E+Concrete+Mathematics%2C+Addison%2DWesley%2C+Reading%2C+MA%2C+p%2E162%2E)
16. Hewlett Packard 1982. HP-15C Advanced Functions Handbook. [find](https://scholar.google.com/scholar?q=Hewlett+Packard+1982%2E+HP%2D15C+Advanced+Functions+Handbook%2E)
17. IEEE 1987. IEEE Standard 754-1985 for Binary Floating-point Arithmetic, IEEE, (1985). Reprinted in SIGPLAN 22(2) pp. 9-25. [find](https://scholar.google.com/scholar?q=IEEE+1987%2E+IEEE+Standard+754%2D1985+for+Binary+Floating%2Dpoint+Arithmetic%2C+IEEE%2C+%281985%29%2E+Reprinted+in+SIGPLAN+22%282%29+pp%2E+9%2D25%2E)
18. Kahan, W. 1972. A Survey Of Error Analysis, in Information Processing 71, Vol 2, pp. 1214 - 1239 (Ljubljana, Yugoslavia), North Holland, Amsterdam. [find](https://scholar.google.com/scholar?q=Kahan%2C+W%2E+1972%2E+A+Survey+Of+Error+Analysis%2C+in+Information+Processing+71%2C+Vol+2%2C+pp%2E+1214+%2D+1239+%28Ljubljana%2C+Yugoslavia%29%2C+North+Holland%2C+Amsterdam%2E)
19. Kahan, W. 1986. Calculating Area and Angle of a Needle-like Triangle, unpublished manuscript. [find](https://scholar.google.com/scholar?q=Kahan%2C+W%2E+1986%2E+Calculating+Area+and+Angle+of+a+Needle%2Dlike+Triangle%2C+unpublished+manuscript%2E)
20. Kahan, W. 1987. Branch Cuts for Complex Elementary Functions, in “The State of the Art in Numerical Analysis”, ed. by M.J.D. Powell and A. Iserles (Univ of Birmingham, England), Chapter 7, Oxford University Press, New York. [find](https://scholar.google.com/scholar?q=Kahan%2C+W%2E+1987%2E+Branch+Cuts+for+Complex+Elementary+Functions%2C+in+%E2%80%9CThe+State+of+the+Art+in+Numerical+Analysis%E2%80%9D%2C+ed%2E+by+M%2EJ%2ED%2E+Powell+and+A%2E+Iserles+%28Univ+of+Birmingham%2C+England%29%2C+Chapter+7%2C+Oxford+Univ)
21. Kahan, W. 1988. Unpublished lectures given at Sun Microsystems, Mountain View, CA. [find](https://scholar.google.com/scholar?q=Kahan%2C+W%2E+1988%2E+Unpublished+lectures+given+at+Sun+Microsystems%2C+Mountain+View%2C+CA%2E)
22. Kahan, W. and Coonen, Jerome T. 1982. The Near Orthogonality of Syntax, Semantics, and Diagnostics in Numerical Programming Environments, in “The Relationship Between Numerical Computation And Programming Languages”, ed. by J. K. Reid, pp. 103-115, North-Holland, Amsterdam. [find](https://scholar.google.com/scholar?q=Kahan%2C+W%2E+and+Coonen%2C+Jerome+T%2E+1982%2E+The+Near+Orthogonality+of+Syntax%2C+Semantics%2C+and+Diagnostics+in+Numerical+Programming+Environments%2C+in+%E2%80%9CThe+Relationship+Between+Numerical+Computation+And+Program)
23. Kahan, W. and LeBlanc, E. 1985. Anomalies in the IBM Acrith Package, Proc. 7th IEEE Symposium on Computer Arithmetic (Urbana, Illinois), pp. 322-331. [find](https://scholar.google.com/scholar?q=Kahan%2C+W%2E+and+LeBlanc%2C+E%2E+1985%2E+Anomalies+in+the+IBM+Acrith+Package%2C+Proc%2E+7th+IEEE+Symposium+on+Computer+Arithmetic+%28Urbana%2C+Illinois%29%2C+pp%2E+322%2D331%2E)
24. Kernighan, Brian W. and Ritchie, Dennis M. 1978. The C Programming Language, Prentice-Hall, Englewood Cliffs, NJ. [find](https://scholar.google.com/scholar?q=Kernighan%2C+Brian+W%2E+and+Ritchie%2C+Dennis+M%2E+1978%2E+The+C+Programming+Language%2C+Prentice%2DHall%2C+Englewood+Cliffs%2C+NJ%2E)
25. Kirchner, R. and Kulisch, U. 1987. Arithmetic for Vector Processors, Proc. 8th IEEE Symposium on Computer Arithmetic (Como, Italy), pp. 256-269. [find](https://scholar.google.com/scholar?q=Kirchner%2C+R%2E+and+Kulisch%2C+U%2E+1987%2E+Arithmetic+for+Vector+Processors%2C+Proc%2E+8th+IEEE+Symposium+on+Computer+Arithmetic+%28Como%2C+Italy%29%2C+pp%2E+256%2D269%2E)
26. Knuth, Donald E., 1981. The Art of Computer Programming, Volume II, Second Edition, Addison-Wesley, Reading, MA. [find](https://scholar.google.com/scholar?q=Knuth%2C+Donald+E%2E%2C+1981%2E+The+Art+of+Computer+Programming%2C+Volume+II%2C+Second+Edition%2C+Addison%2DWesley%2C+Reading%2C+MA%2E)
27. Kulisch, U. W., and Miranker, W. L. 1986. The Arithmetic of the Digital Computer: A New Approach, SIAM Review 28(1), pp 1-36. [find](https://scholar.google.com/scholar?q=Kulisch%2C+U%2E+W%2E%2C+and+Miranker%2C+W%2E+L%2E+1986%2E+The+Arithmetic+of+the+Digital+Computer%3A+A+New+Approach%2C+SIAM+Review+28%281%29%2C+pp+1%2D36%2E)
28. Matula, D. W. and Kornerup, P. 1985. Finite Precision Rational Arithmetic: Slash Number Systems, IEEE Trans. on Comput. C-34(1), pp 3-18. [find](https://scholar.google.com/scholar?q=Matula%2C+D%2E+W%2E+and+Kornerup%2C+P%2E+1985%2E+Finite+Precision+Rational+Arithmetic%3A+Slash+Number+Systems%2C+IEEE+Trans%2E+on+Comput%2E+C%2D34%281%29%2C+pp+3%2D18%2E)
29. Nelson, G. 1991. Systems Programming With Modula-3, Prentice-Hall, Englewood Cliffs, NJ. [find](https://scholar.google.com/scholar?q=Nelson%2C+G%2E+1991%2E+Systems+Programming+With+Modula%2D3%2C+Prentice%2DHall%2C+Englewood+Cliffs%2C+NJ%2E)
30. Reiser, John F. and Knuth, Donald E. 1975. Evading the Drift in Floating-point Addition, Information Processing Letters 3(3), pp 84-87. [find](https://scholar.google.com/scholar?q=Reiser%2C+John+F%2E+and+Knuth%2C+Donald+E%2E+1975%2E+Evading+the+Drift+in+Floating%2Dpoint+Addition%2C+Information+Processing+Letters+3%283%29%2C+pp+84%2D87%2E)
31. Sterbenz, Pat H. 1974. Floating-Point Computation, Prentice-Hall, Englewood Cliffs, NJ. [find](https://scholar.google.com/scholar?q=Sterbenz%2C+Pat+H%2E+1974%2E+Floating%2DPoint+Computation%2C+Prentice%2DHall%2C+Englewood+Cliffs%2C+NJ%2E)
32. Swartzlander, Earl E. and Alexopoulos, Aristides G. 1975. The Sign/Logarithm Number System, IEEE Trans. Comput. C-24(12), pp. 1238-1242. [find](https://scholar.google.com/scholar?q=Swartzlander%2C+Earl+E%2E+and+Alexopoulos%2C+Aristides+G%2E+1975%2E+The+Sign%2FLogarithm+Number+System%2C+IEEE+Trans%2E+Comput%2E+C%2D24%2812%29%2C+pp%2E+1238%2D1242%2E)
33. Walther, J. S., 1971. A unified algorithm for elementary functions, Proceedings of the AFIP Spring Joint Computer Conf. 38, pp. 379-385. [find](https://scholar.google.com/scholar?q=Walther%2C+J%2E+S%2E%2C+1971%2E+A+unified+algorithm+for+elementary+functions%2C+Proceedings+of+the+AFIP+Spring+Joint+Computer+Conf%2E+38%2C+pp%2E+379%2D385%2E)
34. Theorem 14 and Theorem 8 This section contains two of the more technical proofs that were omitted from the text. Theorem 14 [find](https://scholar.google.com/scholar?q=Theorem+14+and+Theorem+8+This+section+contains+two+of+the+more+technical+proofs+that+were+omitted+from+the+text%2E+Theorem+14)

*Updated 2 November 2026*
