thegooglecodearchive / pymssql

Automatically exported from code.google.com/p/pymssql
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Precision problems #79

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I found that saving doubles to a SQLServer database via pymssql resulted in a 
loss of precision.  Specifically, if i retrieve a double after saving it, it 
only matches up to around 8 digits (which is approximately what you can expect 
from single precision, instead of double precision).
I also found that doubles were translated to strings using str instead of repr. 
 Python only guarantees that float(repr(x)) == x, not that float(str(x)) == x.

I created a fork of this project that includes two changes related to 
precision.  The fork is http://code.google.com/r/dieterv77-pymssql/
and the commit is 4c3e2271dd7e.

There is also a unrelated, minor speed improvement in commit bd9a2213b632.

Thanks very much

Original issue reported on code.google.com by dieterv77 on 29 Dec 2011 at 2:43

GoogleCodeExporter commented 9 years ago
Thanks for the report, looks like good changes.

Original comment by rsyr...@gmail.com on 8 Mar 2012 at 2:47

GoogleCodeExporter commented 9 years ago

Original comment by rsyr...@gmail.com on 3 Apr 2012 at 5:08