Thread: Values went missing after calculation...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    32

    Values went missing after calculation...

    After the some calculations with float values, instead of showing something like: 123.4567890, wierd characters of: 1.#IND00000 were displayed......

    What are the possible causes for this to happen? And what does it mean by 1.#IND00000???

    _____

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    What are the calculations you're doing? And did you actually try doing a simple google search? Because I did one and found this link:
    http://www.kbalertz.com/kb_156919.aspx
    If you understand what you're doing, you're not learning anything.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    #INF - infinity (mostly because things have gotten really big)
    #IND - indefinite (mostly because things have gotten really small)
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User
    Join Date
    Feb 2005
    Posts
    32
    Yes that is it! It happened when I divide a value by zero. My question is: How to use if statement as a condition for #IND values?

    i.e:
    if (value != Indefinedvalues)

    if the value is not a zero I can just:
    if (value != 0)...

    But how to do it for indefined values?
    if (value != #IND) ?

    How?

    _____

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    There may be something in either math.h or float.h (can't remember)
    Something along the lines of isInf(), isNan() etc.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    int isfinite(fpval)
    int isinf(fpval)
    int isnan(fpval)
    int isnormal(fpval)

    are all defined in <math.h>
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sending values to a control
    By Zyk0tiK in forum C Programming
    Replies: 6
    Last Post: 12-02-2005, 06:29 PM
  2. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM
  3. Erros in Utility Header File
    By silk.odyssey in forum C++ Programming
    Replies: 4
    Last Post: 12-22-2003, 06:17 AM
  4. header file bringing errors?
    By bluehead in forum Windows Programming
    Replies: 4
    Last Post: 08-19-2003, 12:51 PM
  5. Checking ascii values of char input
    By yank in forum C Programming
    Replies: 2
    Last Post: 04-29-2003, 07:49 AM