Not a Number of Floating Point Problems.

Gary T. Leavens · The Journal of Object Technology · 2006

Floating-point numbers and floating-point arithmetic contain some surprising pitfalls.In particular, the widely-adopted IEEE 754 standard contains a number that is "not a number," and thus has some surprising properties.One has to be extremely careful in writing assertions about floating point numbers, to avoid these pitfalls.This column describes the problems and how a language might eliminate them.That Indian bread is heavenly, isn't it?Yes, it's nan of the above.1 Technically there is one such NaN value for each floating-point type; for example Java has Float.NaN and Double.NaN.

Read the paper · More papers on PaperTik