Decimal problem -1.#IND

This is a discussion on Decimal problem -1.#IND within the C++ Programming forums, part of the General Programming Boards category; In my programme for an optimation problem, my need to divide a function by a number smaller than 0.000001 couldn't ...

  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    3

    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?

    Thanks!

  2. #2
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    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
    Posts
    722
    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, 09:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21