SQL Server Real and Float datatype cast conversions do not match
<p>We are undergoing a migration in our tool. Some of the datatypes in our tables have been changed from real to float. To understand the impact I have run the following code:</p>

<pre><code>declare @realVariable as real,
@floatVariable as float

set @realVariable=152304.11999512
set @floatVariable=152304.11999512

select cast(@realVariable AS decimal(15, 4)) as realcol,str(@floatVariable,15,4) as floatcol
</code></pre>

<p>The result is different for both real and float variables:
real=152304.1250
float=    152304.1200</p>

<p>How can I make sure that the float result is same as real?</p>