d3dx9_36: Use cross-platform versions of infinity and NaN.

Misha Koshelev misha680 at gmail.com
Sat Jul 9 09:16:27 CDT 2011


On Tue, Jul 5, 2011 at 8:18 AM, Dylan Smith <dylan.ah.smith at gmail.com> wrote:
> On Tue, Jul 5, 2011 at 8:27 AM, Marvin <testbot at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 1282 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20110709/69818de8/attachment.obj>


More information about the wine-devel mailing list