Steve Eckhart (8/26/2010)
Very good question. I discovered that whether or not 0.9 + 0.1 <> 1 is not consistent I guess depending on sequence. If you execute the following in SQL Server 2005, you get "Equal":
declare @f float
set @f = 0.9
set @f = @f + 0.1
if @f <> 1
print 'Not Equal'
else
print 'Equal'
try this one:
declare @f float
set @f = 0
set @f = @f + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1
print 1 - @f