문제

Monniaux's excellent article, "The Pitfalls of Verifying Floating Point Arithmetic", gives examples of unexpected numerical behavior. However, most of the examples depend on extended precision FPUs or extended precision operations (e.g. multiply-accumulate). Besides signed zero and comparisons involving NaN are there any good examples of surprising numerical behavior when extend precision hardware is disabled?

도움이 되었습니까?

해결책

An example that is often surprising to programmers is when x + 1 == x. In single precision floating point, this is true for x as small as 2^25 because of the limited precision of the mantissa. This often comes up when incrementing time values in a simulation by a small timestep. A similar problem affected the Patriot missile.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top