SQL Server compare two decimals is not exact
<p>I am using SQL Server 2008 R2. Why is this comparison returning true? Values are 1.98 and 2.2, which is very different:</p>

<pre><code>declare @num1 decimal = 1.98;
declare @num2 decimal = 2.2;

if(@num1 != @num2)
    select 0;
else if(@num1 = @num2)
    select 1;
</code></pre>