I'm using Microsoft Server SQL.
I'm not sure why this is happening. My only geuss so far is that the value is 32.49999 under the hood or something. But the same equation does not fail when using different values like 32.32 etc.
Can anyone please explain why this is happening?
select
cast(32.55 as float)
,cast(32.55 as float) * 1000
,case when cast(32.55 as float) * 1000 <> 32550 then 'F' ELSE 'C' END as [vanilla]
,case when cast(cast(32.55 as float) * 1000 as int) <> cast(32550 as int) then 'F' ELSE 'C' END as [int]
,case when cast(cast(32.55 as float) * 1000 as varchar(max)) <> cast(32550 as varchar(max)) then 'F' ELSE 'C' END as [varchar]
,case when cast(cast(32.55 as float) * 1000 as float) <> cast(32550 as float) then 'F' ELSE 'C' END as [float]
,case when round(cast(32.55 as float) * 1000,0) <> round(32550,0) then 'F' ELSE 'C' END as [round]
,case when cast(cast(32.55 as float) * 1000 as decimal(18,2)) <> cast(32550 as decimal(18,2)) then 'F' ELSE 'C' END as [decimal]