Posted by mpaine on 11/20/06 20:57
Ok, I just figured it out:
DECLARE @A int
DECLARE @B int
DECLARE @C float
SET @A = 1
SET @B = 26
SET @C = CAST(@A AS float) / (CAST(@A AS float) + CAST(@B AS float))
PRINT @C
This is unlike any other programming language that I have used before
-- so strange.
mpaine@htxml.com wrote:
> Why does this T-SQL round incorrectly?
>
> PRINT 1/(1+26)
>
> when it should be 0.037037037?
>
> Thanks,
> Michael
[Back to original message]
|