Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
This chapter only covers the basics. There is an entire science, Numerical Analysis, devoted to studying the behavior of numeric calculations and devising methods to minimize the impact of floating point errors. This chapter does serve as a brief introduction to the subject. | Chapter - 19 Floating Point Floating Point Format Is the sign plus or minus . f.fff Is the 4 digit fraction. e Is the single-digit exponent. Zero is 0.0 We represent these numbers in E format f.fffE e. Examples Notation Number 1.000E 0 1.0 3.300E 5 330000 -8.223E-3 -0.01 0.000E 0 0.0 Floating Point Add Sub 1. Start with the numbers 2.000E 0 The number is 2.0 3.000E-1 The number is 0.3 2. Add guard digits to both numbers 2.0000E 0 The number is 2.0 3.0000E-1 The number is 0.3 3. Shift the number with the smallest exponent to the right one digit and numbers match. 2.0000E 0 The number is 2.0 0.3000E-0 The number is 0.3 4. Add the two fractions. The result has the same exponent a s the two numbers. 2.0000E 0 The number is 2.0 0.3000E-0 The number is 0.3 2.3000E 0 Result .