On 10/22/2015 4:25 PM, Rousselot, Richard A wrote: > I fully expected something like this from a fractional number like 1/3 but > didn't realize that this would be the case if when the digits were explicitly > stated and they summed to a whole number. I will use a Cast statement to > resolve.
Just like 1/3 cannot be precisely represented as a finite decimal fraction, 1/10 aka 0.1 cannot be precisely represented as a finite binary fraction - which is what a floating point value really is. > FWIW, MySQL and Oracle both return all yes for that query. In MySQL, 9.2 is a literal of DECIMAL type, which is in fact represented as a finite decimal fraction. SQLite doesn't have such a type. You would likely observe similar results in MySQL if you write your constants like this: 9.2e0 (scientific notation makes them have FLOAT or DOUBLE type). See also: https://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html -- Igor Tandetnik