Strange float bug?

"Brett Bibby" <[email protected]>
Newsgroups gmane.games.devel.windows
Organization GameBrains
Message-ID <[email protected]>
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=click
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.