Stefan Krah <stefan-use...@bytereef.org> added the comment: I've looked at the latest patch: It seems that new_387controlword is not set if old_387controlword already has the desired precision and rounding mode.
Attached is a revised patch that uses the same logic as the Linux version. A couple of remarks: - It would be possible to negate (_PC_53|_RC_NEAR) instead of enumerating (_MCW_DN|_MCW_EM|_MCW_IC). I found it nice to see all possibilities listed. - Technically we might need to use #pragma fenv_access (on). I'm not sure where though: If it is set in pyport.h, VS complains that Py_MATH_PI / 180.0 is not constant. The patch is tested on win32/x64. Additionally, the patch is tested with setting the rounding mode to _PC_64 in main.c. Then, the patch is tested with replacing the 'if' bodies by 'abort()'. This shows that in the regular build (_PC_53 on startup) the bodies of the if statements are never executed. Finally, inserting an #error after #if defined(_MSC_VER) && !defined(_WIN64) on the x64 build shows that !defined(_WIN64) really does its job. ---------- Added file: http://bugs.python.org/file24819/issue13889.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13889> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com