Page: 11 prev next


Floating-Point Arithmetic



All the usual mathematical operations used in hand calculations have floating-point analogs that are used in computer-based calculations.

However, some care is required when using the floating-point versions of mathematical operations because they do not follow the deeply engrained rules we all take for granted.

For example,
(2.5 - 2.4)/0.1      = 1.0000000000000008881...65625
while
2.5/0.1 - 2.4/0.1 = 1.0000000000000035527...90625