Real number testing

In DB2, real numbers (datatypes REAL, FLOAT, DOUBLE, and DOUBLE PRECISION) are stored as approximations. This means that equality tests on real numbers may not locate all rows expected. The recommended way of testing for a real number value is to use a range test. For example, if you want to locate all rows where the column “A” has a value of 1.2345678, issue this select statement:

select.....from.....where A between 1.234567 and 1.234568