in .NET, when I add two SqlDecimals, like so:
SqlDecimal s1 = new SqlDecimal(1);
SqlDecimal s2 = new SqlDecimal(1);
SqlDecimal s3 = s1 + s2;
then s3 has precision 2, whereas both s1 and s2 have precision 1.
This seems odd, especially as the documentation states that the return value of the addition operator is "A new SqlDecimal structure whose Value property contains the sum." I.e. according to the documentation, addition should not change the precision.
Am I missing something here? Is this intended behaviour?
Cheers,
Tilman