CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2006
    Posts
    99

    Angry a -1.#IND problem

    hello guys,

    my program crashes, because some of the floats have a value of -1.#IND

    i know it is a symbol for infinity and probably caused by overflow.

    but my question is how to debug this error.

    i want to add some lines in the code like:

    if(value==-1.#IND)
    ...

    therefore, i can identify the location where the wrong value is computed.

    however, it seems that the compiler i'm using, which is visual studio 2008, doesn't recognize "-1.#IND"

    so i don't know how to do this. please help. thank you very much.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: a -1.#IND problem

    You might have isinf() and isnan() functions available. Not every compiler does, but they're handy if you have them.....

  3. #3
    Join Date
    May 2007
    Posts
    811

    Re: a -1.#IND problem

    If you are using Visual Studio, you can turn specific Exceptions on so you can catch it in debugger right when it happens.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured