Thread: Decimal problem -1.#IND

  1. #1
    Registered User
    Join Date
    May 2005

    Decimal problem -1.#IND

    In my programme for an optimation problem, my need to divide a function by a number smaller than 0.000001 couldn't be done by the default setting in C because the result turn out to be "-1.#IND". How can I make some changes to solve the problem?


  2. #2
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Cayman Islands
    Based on your limited info, I would suggest using a long double. I need to see some code to be more specific or at least better specs

  3. #3
    Registered User
    Join Date
    Jun 2004
    that happens because in your programme the 0.000001 is being treated like zero, and division by zero results in error. That's what being printed -1.#IND less infinte.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. binary decimal conversion
    By eerok in forum C Programming
    Replies: 2
    Last Post: 01-24-2006, 09:51 PM
  2. problem getting decimal not to = 0
    By scoketboy in forum C Programming
    Replies: 4
    Last Post: 12-14-2005, 05:03 PM
  3. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  4. decimal being stored as 0
    By scoketboy in forum C Programming
    Replies: 7
    Last Post: 11-05-2005, 02:31 AM
  5. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM