Floating-point numbers: a visit through the looking glass
William Gould
2014 Stata Conference 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-08-02
New Economics Papers: this item is included in nep-cmp
References: Add references at CitEc
Citations:
Downloads: (external link)
http://repec.org/bos2014/boston14_gould.pdf (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: https://EconPapers.repec.org/RePEc:boc:scon14:22
Access Statistics for this paper
More papers in 2014 Stata Conference from Stata Users Group Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().