Economics at your fingertips  

Floating-point numbers: A visit to the looking glass world

William Gould

United Kingdom Stata Users' Group Meetings 2014 from Stata Users Group

Abstract: Researchers do not adequately appreciate that floating-point numbers are a simulation of real numbers and, as with all simulations, some features are preserved while others are not. When writing code, or even do-files, treating the computer's floating-point numbers as if they were real numbers can lead to substantive problems and to numerical inaccuracy. In this, the relationship between computers and real numbers is not entirely unlike the relationship between tea and Douglas Adams' Nutri-Matic drink dispenser. The Nutri-Matic produces a concoction that is "almost, but not quite, entirely unlike tea." Gould shows what the universe would be like if it was implemented in floating-point rather than in real numbers. The floating-point universe turns out to be nothing like the real universe and probably could not be made to function. Without jargon and without resort to binary, Gould shows how floating-point numbers are implemented on an imaginary base-10 computer and quantifies the kinds of errors that can arise. In this, floating-point subtraction stands out as really being almost, but not quite, entirely unlike subtraction. Gould shows out how to work around such problems. The point of the talk is to build your intuition about the floating-point world so that you as a researcher can predict when calculations might go awry, know how to think about the problem, and determine how to fix it.

Date: 2014-09-28
New Economics Papers: this item is included in nep-cmp
References: Add references at CitEc
Citations: Track citations by RSS feed

Downloads: (external link) (application/pdf)

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link:

Access Statistics for this paper

More papers in United Kingdom Stata Users' Group Meetings 2014 from Stata Users Group Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().

Page updated 2023-06-15
Handle: RePEc:boc:usug14:08