On Tue, Jul 5, 2011 at 8:18 AM, Dylan Smith dylan.ah.smith@gmail.com wrote:
On Tue, Jul 5, 2011 at 8:27 AM, Marvin testbot@testbot.winehq.org wrote:
=== WXPPROSP3 (32 bit math) === math.c:2275: Test failed: Got ffff, expected 7fff or 7fff for index 18.
0.0f/0.0f = -nan (0xffc00000) -(0.0f/0.0f) = nan (0x7fc00000)
msvc complains about dividing by zero. I found the following works around the error for MS Visual Studio 2010, although later version might try to be "smarter".
static const float z = 0.0f; const float neg_nan = 0.0f/z; const float pos_nan = -(0.0f/z);
Note that neg_nan and pos_nan can't be static.
Thank you for figuring this out.
Does the attached patch work on MS Visual Studio 2010? This passes all tests.
Your version does not seem to convert properly to +NAN on some platforms (e.g., Linux) and results in some test failures.
Thank you Misha