Back to Search Start Over

Introduction to numeric precision and representation issues: why 4.8 minus 4.6 is not always equal to 0.2.

Authors :
Tambascia, Nicola
Source :
Pharmaceutical Programming; Dec2011, Vol. 4 Issue 1/2, p107-113, 7p
Publication Year :
2011

Abstract

Numeric precision and representation issues are well-known topics in computer science. Non computer scientists sometimes are not aware of the problems that occur with these issues. This paper provides a brief introduction to problems based on numeric precision and the presentation of numbers on computerized systems. Numbers are stored as binary numbers in computerized systems. However, not all floating-point numbers can be represented properly in the binary system. When calculating with numbers that cannot be stored exactly, the result may not be as expected. In our case, 4.8 and 4.6 can not be stored exactly and therefore, the result of 4.8 minus 4.6 will not be exactly 0.2. The conversion of floating-point numbers to a storable IEEE-754 binary number is illustrated. Finally, some SAS functions and options are introduced that may help to deal with the issue. [ABSTRACT FROM AUTHOR]

Details

Language :
English
ISSN :
17570921
Volume :
4
Issue :
1/2
Database :
Complementary Index
Journal :
Pharmaceutical Programming
Publication Type :
Academic Journal
Accession number :
70101089
Full Text :
https://doi.org/10.1179/175709311X13166801334398