[issue13889] str(float) and round(float) issues with FPU precision

2012-02-06 Thread Samuel Iseli
Samuel Iseli added the comment: Completed the patch by adding the rounding-control bits to the mask (_MCW_RC) and making sure the macros only get defined for MS-VC compiler (#ifdef _MSC_VER). Ran the tests (python_d -m test.autotest) on win32. Seems OK. The tests that were skipped or failed

[issue13889] str(float) and round(float) issues with FPU precision

2012-02-05 Thread Samuel Iseli
Samuel Iseli added the comment: I can run the tests on 32bit. Would be nice if somebody else could do this on 64bit (my VS2008 machine is currently on 32bit-Windows). -- ___ Python tracker <http://bugs.python.org/issue13

[issue13889] str(float) and round(float) issues with FPU precision

2012-02-03 Thread Samuel Iseli
Samuel Iseli added the comment: There's an excess space after a line continuation backslash in my last patch, so it doesn't compile (pyport.h, line 567). Here's an additional patch that removes the space. Didn't find out how to combine the 2 revisions in one patch-file.

[issue13889] str(float) and round(float) issues with FPU precision

2012-02-03 Thread Samuel Iseli
Samuel Iseli added the comment: I would definitely classify this as a bug in Python 2.7 as it breaks backwards-compatibility for embedding environments that default to 64bit FPU precision (e.g. Delphi). Additionally the bug is very hard to detect and leads to wrong values with possibly

[issue13889] str(float) and round(float) issues with FPU precision

2012-01-29 Thread Samuel Iseli
Samuel Iseli added the comment: Hi Marc, the changes to the pythoncore.vcproj Visual-Studio file define the HAVE_VC_FUNC_FOR_X87 symbol. I use this symbol to enable the precision-setting macros in pyport.h. I made this similar to the existing code for gcc (linux). You can change this but

[issue13889] str(float) and round(float) issues with FPU precision

2012-01-27 Thread Samuel Iseli
New submission from Samuel Iseli : We are using python as an embedded scripting environment in our ERP-product. Since upgrading to python2.7 we have serious issues with floats: >>> 28710.0 '2870:.0' >>> round(28710.0) 2870.0 We are embedding Python in a Delphi-a