ACM Home Page
Please provide us with feedback. Feedback
How to read floating point numbers accurately
Full text pdf formatPdf (1.04 MB)
Source Conference on Programming Language Design and Implementation archive
Proceedings of the ACM SIGPLAN 1990 conference on Programming language design and implementation table of contents
White Plains, New York, United States
Pages: 92 - 101  
Year of Publication: 1990
ISBN:0-89791-364-7
Also published in ...
Author
William D. Clinger  University of Oregon
Sponsor
SIGPLAN: ACM Special Interest Group on Programming Languages
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 6,   Downloads (12 Months): 127,   Citation Count: 16
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues   peer to peer  

Tools and Actions: Review this Article  
Save this Article to a Binder    Display Formats: BibTex  EndNote ACM Ref   
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/93542.93557
What is a DOI?

ABSTRACT

Consider the problem of converting decimal scientific notation for a number into the best binary floating point approximation to that number, for some fixed precision. This problem cannot be solved using arithmetic of any fixed precision. Hence the IEEE Standard for Binary Floating-Point Arithmetic does not require the result of such a conversion to be the best approximation. This paper presents an efficient algorithm that always finds the best approximation. The algorithm uses a few extra bits of precision to compute an IEEE-conforming approximation while testing an intermediate result to determine whether the approximation could be other than the best. If the approximation might not be the best, then the best approximation is determined by a few simple operations on multiple-precision integers, where the precision is determined by the input. When using 64 bits of precision to compute IEEE double precision results, the algorithm avoids higher-precision arithmetic over 99% of the time. The input problem considered by this paper is the inverse of an output problem considered by Steele and White: Given a binary floating point number, print a correctly rounded decimal representation of it using the smallest number of digits that will allow the number to be read without loss of accuracy. The Steele and White algorithm assumes that the input problem is solved; an imperfect solution to the input problem, as allowed by the IEEE standard and ubiquitous in current practice, defeats the purpose of their algorithm.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
Clinger90
Clinger, William, and Jonathan Rees {editors}. Revisedn report on the algorithmic language Scheme. Technical Report CIS-TR-90-02, Department of Computer and Information Science, University of Oregon, 1990.
 
Coonen80
Coonen, Jerome T. An implementation guide to a proposed standard for floating-point arithmetic. Computer 13, 1, January 1980, pages 68-79.
Goldberg67
 
HW60
Hardy, G. H., and E. M. Wright. An Introduction to the Theory of Numbers, Fourth Edition. Oxford University Press, 1960.
 
IEEE85
- IEEE Standard 754-1985. IEEE Standard for Binary Floating-Point Arithmetic. IEEE, New York, 1985.
 
Knuth81
Matula68
 
Matula70
Matula, David W. A formalization of floatingpoint numeric base conversion. IEEE Transactions on Computers, C-19, 8, August 1970, pages 681-692.
Rees86
Steele90

CITED BY  16
 
 
 
 


Peer to Peer - Readers of this Article have also read: