Floating Point/Comparing FP Numbers

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Floating Point Comparisons[edit | edit source]

It has been said by many people that floating point numbers should never be compared directly to each other for equality, although this is not strictly true. This page will discuss some common techniques and fallacies for comparing floating point numbers for equality and inequality.