• nisan.al (8/29/2010)


    I can't say i completely understand this issue.

    The while statement dont not stop because @i will never be equal to 1

    So how come the following select return 1 ?

    DECLARE @i float

    set @i = 0

    set @i = @i + 0.2

    set @i = @i + 0.2

    set @i = @i + 0.2

    set @i = @i + 0.2

    set @i = @i + 0.2

    SELECT 1

    WHERE @i=1

    As said above, the increment of 0.2 (precise) is different from 0.1 (approximate)