Analysis of Some Strange Behaviors of Floating Point Arithmetic using MATLAB Programs

MATLAB을 이용한 부동소수점 연산의 특이사항 분석

  • 정태상 (중앙대학교 전자전기공학부)
  • Published : 2007.02.01

Abstract

A floating-point number system is used to represent a wide range of real numbers using finite number of bits. The standard the IEEE adopted in 1987 divides the range of real numbers into intervals of [$2^E,2^{E+1}$), where E is an Integer represented with finite bits, and defines equally spaced equal counts of discrete numbers in each interval. Since the numbers are defined discretely, not only the number representation itself includes errors but in floating-point arithmetic some strange behaviors are observed which cannot be agreed with the real world arithmetic. In this paper errors with floating-point number representation, those with arithmetic operations, and those due to order of arithmetic operations are analyzed theoretically with help of and verification with the results of some MATLAB program executions.

Keywords

References

  1. Moler, C., ' A Tale of Two Numbers,' SIAM News, Vol. 28, No.1, pp. 1, 16, 1995
  2. http://www.math.psu.edu/dna/455.f96/disasters.html
  3. IEEE Standard for Binary Floating-Point Arithmetic (ANSV'IEEE Std 754-1985), IEEE Press, 1985
  4. The Student Edition of MATLAB, User's Guide, Prentice Hall, Englewood Cliffs, NJ 1995
  5. Kuck, D. J.. D. S. Parker and A. H. Sameh, 'Analysis of Rounding Methods in Floating-Point Arithmetic,' IEEE Trans. Computers, Vol. 26, No.7, pp. 643-50, 1977 https://doi.org/10.1109/TC.1977.1674897