Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. debugging

debugging

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++debuggingtutoriallearning
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rajveer
    wrote on last edited by
    #1

    I've just started learning how to debug, and I'm still kinda new with C++ programming language. I have two variables declared as doubles: x, slope while debugging, I noticed that sometimes in the loop they're values came up as: slope = 1.#INF000000000 x = -1.#IND000000000 what does that mean?....why does it happen?

    T T 3 Replies Last reply
    0
    • R Rajveer

      I've just started learning how to debug, and I'm still kinda new with C++ programming language. I have two variables declared as doubles: x, slope while debugging, I noticed that sometimes in the loop they're values came up as: slope = 1.#INF000000000 x = -1.#IND000000000 what does that mean?....why does it happen?

      T Offline
      T Offline
      Tim Smith
      wrote on last edited by
      #2

      (EDIT: Corrections) 1.#INF stands for positive infinity. 1.#IND stands for positive ideterminite. If you add a negative, then they are negative infinity. This can happen if a variable has yet to be initialized. It can also happen during ASCII to float conversions and math operations. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?

      L 1 Reply Last reply
      0
      • R Rajveer

        I've just started learning how to debug, and I'm still kinda new with C++ programming language. I have two variables declared as doubles: x, slope while debugging, I noticed that sometimes in the loop they're values came up as: slope = 1.#INF000000000 x = -1.#IND000000000 what does that mean?....why does it happen?

        T Offline
        T Offline
        Tomasz Sowinski
        wrote on last edited by
        #3

        1.#INF means positive infinity - usually you get it when you divide by zero. 1.#IND represents so-called 'quiet-nan' - for example, when you take the logarithm of negative value. Tomasz Sowinski -- http://www.shooltz.com
        ** If you're going to rape, pillage and burn, be sure to do things in that order. **

        L 1 Reply Last reply
        0
        • T Tim Smith

          (EDIT: Corrections) 1.#INF stands for positive infinity. 1.#IND stands for positive ideterminite. If you add a negative, then they are negative infinity. This can happen if a variable has yet to be initialized. It can also happen during ASCII to float conversions and math operations. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          So can I use that value just like other values in my code, for example in an if statement, could I say: if(x==1.#INF) { //do stuff } or when I say if(x>=9000) { //do stuff } will the infinite value be regarded as greater than 9000?

          T 1 Reply Last reply
          0
          • T Tomasz Sowinski

            1.#INF means positive infinity - usually you get it when you divide by zero. 1.#IND represents so-called 'quiet-nan' - for example, when you take the logarithm of negative value. Tomasz Sowinski -- http://www.shooltz.com
            ** If you're going to rape, pillage and burn, be sure to do things in that order. **

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            So can I use that value just like other values in my code, for example in an if statement, could I say: if(x==1.#INF) { //do stuff } or when I say if(x>=9000) { //do stuff } will the infinite value be regarded as greater than 9000?

            D 1 Reply Last reply
            0
            • R Rajveer

              I've just started learning how to debug, and I'm still kinda new with C++ programming language. I have two variables declared as doubles: x, slope while debugging, I noticed that sometimes in the loop they're values came up as: slope = 1.#INF000000000 x = -1.#IND000000000 what does that mean?....why does it happen?

              T Offline
              T Offline
              Tim Smith
              wrote on last edited by
              #6

              1.INF/-1.INF = Positive/Negative infinity 1.IND/-1.IND = Positive/Negative indeterminate 1.QNAN/-1.QNAN = Positive/Negative quiet not-a-number 1.NAN/-1.NAN = Positive/Negative not-a-number IEEE Reference information Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?

              1 Reply Last reply
              0
              • L Lost User

                So can I use that value just like other values in my code, for example in an if statement, could I say: if(x==1.#INF) { //do stuff } or when I say if(x>=9000) { //do stuff } will the infinite value be regarded as greater than 9000?

                T Offline
                T Offline
                Tim Smith
                wrote on last edited by
                #7

                You can use _finite to test to see if a value is finite. Thus your NAN, QNAN, INF, IND should return false. (???) Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?

                1 Reply Last reply
                0
                • L Lost User

                  So can I use that value just like other values in my code, for example in an if statement, could I say: if(x==1.#INF) { //do stuff } or when I say if(x>=9000) { //do stuff } will the infinite value be regarded as greater than 9000?

                  D Offline
                  D Offline
                  DRHuff
                  wrote on last edited by
                  #8

                  Don't - instead figure out what is setting the bad values. Those numbers indicate that you are doing something wrong. If the variables are uninitialized there is no guarantee that they will always be the same. If you are dividing by 0 or taking the log of a negative number you should be checking your inputs because they are faulty. Dave Huff There are no small projects - only young ones.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups