Thread: sprintf of float giving "1.#QO"

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    1

    sprintf of float giving "1.#QO"

    Hi,

    I am having an intermittent problem. It's a C++ program written in VC++ 6.0 (very old, I know). It's a fairly complex application with some fairly complex mathematical calculations. Most of it wasn't written by me. Anyway, every once in a while one of the fields on the screen shows "1.#QO" instead of the proper result. This MIGHT be just the beginning of the string, because of the size of the field is limited.

    I am sure it's a bad calculation somewhere that probably results in an invalid floating point number. Does anyone have an idea that could help me narrow my search?

    Thanks

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Is some sort of isnan function available for use with some debugging code near where the output is generated?
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    You may also find enabling x87 exceptions may help:
    http://msdn2.microsoft.com/en-us/library/e9b52ceh.aspx

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 05-13-2009, 03:25 PM
  2. Replies: 14
    Last Post: 06-28-2006, 01:58 AM
  3. Could somebody please help me with this C program
    By brett73 in forum C Programming
    Replies: 6
    Last Post: 11-25-2004, 02:19 AM
  4. Half-life SDK, where are the constants?
    By bennyandthejets in forum Game Programming
    Replies: 29
    Last Post: 08-25-2003, 11:58 AM
  5. How do you search & sort an array?
    By sketchit in forum C Programming
    Replies: 30
    Last Post: 11-03-2001, 05:26 PM