B
Beat Bucheli
Hello,
I'm trying to do some simple calculations with System.Data.SqlDecimal on
..NET 2.0:
SqlDecimal one = new SqlDecimal(1);
SqlDecimal seven = new SqlDecimal(7);
SqlDecimal oneBySeven = SqlDecimal.Divide(one, seven);
The precision of the result in oneBySeven is way below my expectations. I
get 0.142857, but I expected something like 0.1428571428571428571428571429
or even more precise. Additional values reported by the debugger:
// Data[0] Data[1] Data[2] Data[3] Precision
Scale Value
// one 0x00000001 0x00000000 0x00000000 0x00000000 1 0
{1}
// seven 0x00000007 0x00000000 0x00000000 0x00000000 1 0
{7}
// oneBySeven 0x00022e09 0x00000000 0x00000000 0x00000000 7 6
{0.142857}
Any explanations? Thanks!
Beat
I'm trying to do some simple calculations with System.Data.SqlDecimal on
..NET 2.0:
SqlDecimal one = new SqlDecimal(1);
SqlDecimal seven = new SqlDecimal(7);
SqlDecimal oneBySeven = SqlDecimal.Divide(one, seven);
The precision of the result in oneBySeven is way below my expectations. I
get 0.142857, but I expected something like 0.1428571428571428571428571429
or even more precise. Additional values reported by the debugger:
// Data[0] Data[1] Data[2] Data[3] Precision
Scale Value
// one 0x00000001 0x00000000 0x00000000 0x00000000 1 0
{1}
// seven 0x00000007 0x00000000 0x00000000 0x00000000 1 0
{7}
// oneBySeven 0x00022e09 0x00000000 0x00000000 0x00000000 7 6
{0.142857}
Any explanations? Thanks!
Beat