RE: Strange float bug?
"Donavon Keithley" <[email protected]>
| Newsgroups | gmane.games.devel.windows |
|---|---|
| Message-ID | <[email protected]> |
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: [email protected] > [mailto:[email protected]] On Behalf Of > Brett Bibby > Sent: Sunday, March 07, 2004 7:39 AM > To: [email protected] > Subject: [GD-Windows] Strange float bug? > > 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 = > (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. > > 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? > > Brett > > > > ------------------------------------------------------- > 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_id70&alloc_id638&op=ick > _______________________________________________ > Gamedevlists-windows mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_idU5 ------------------------------------------------------- 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_id70&alloc_id638&op=click _______________________________________________ Gamedevlists-windows mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_idU5