c++ - I'm having a problem identifying a floating point exception -


I am using c ++ in Visual Studio Express which is a random expression for use in a genetic algorithm type program Produces trees.

Because they are random, the trees often produce (I mean exception to them, I'm not sure what they are) Thanks for a suggestion by, I mask _MCW_EM Turn on so that hardware interrupts are closed (Default)

Then, the program is constantly running, but some values ​​are returned: -1. #INF, -1 #NAN, -1. # INV

> I do not know how to identify them so that I can remove a remission:

if (variable == -1 .INF)

There is a solution in DigitalRoss, but as I understood it I could not work it.

I'm looking for this simple bit code everywhere, I think everyone will be used

time, but there is no luck.

Thanks

Try it out:

  #include & lt; Border & gt; If (variable == numeric_limits & lt; float & gt; :: infinity ()) return1;  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -