Why decimal behave differently?

Posted by haansi on Stack Overflow See other posts from Stack Overflow or by haansi
Published on 2010-04-12T13:17:23Z Indexed on 2010/04/12 13:23 UTC
Read the original article Hit count: 368

Filed under:
|
|
|

Hello,

I am doing this small exercise.

declare @No decimal(38,5);
set @No=12345678910111213.14151;

select @No*1000/1000,@No/1000*1000,@No;

Results are:

12345678910111213.141510    
12345678910111213.141000    
12345678910111213.14151

Why are the results of first 2 selects different when mathematically it should be same?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2005