RE: [GD-Windows] Strange float bug?
Brought to you by:
vexxed72
From: Donavon K. <kei...@ea...> - 2004-03-07 19:23:36
|
Sounds like a and/or b is set to an SNaN prior to this line, so you'll want to figure out how that's happening. I'd be willing to bet that you're dereferencing a bad float pointer or indexing outside of a float array, which would explain why the exception has been sporadic. (FPU ops never generate SNaNs.) Denormalized values are a different issue and shouldn't result in a NaN under add and subtract operations. Also note that _controlfp doesn't affect the denormal exception mask on x86. Donavon Keithley > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On Behalf Of > Brett Bibby > Sent: Sunday, March 07, 2004 7:39 AM > To: Gam...@li... > Subject: [GD-Windows] Strange float bug? >=20 > We have been tracking down the wierdest bug for several days. Our code was > crashing randomly and then we finally found a repeatable case where an > assert on an identity matrix when we check the orthonormalness of it and > we chanced upon a line of code that returned -nan that was simply x = =3D > (1.0f - (a + b)). Anyway, I suddenly remembered a GDC talk about Windows > denormals, did a quick google and pasted a _controlfp( _CW_DEFAULT, > 0xfffff ) into our code and presto it now works. >=20 > We make games for PS2 and GCN and are Windows amateurs, but I hate the > idea of not understanding what went wrong and how to properly handle this. > Has anybody ever encountered something like this before? >=20 > Brett >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=3Dick > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_idU5 |