62
ryan
8y

You know your code is broken when it outputs -0....

Comments
  • 4
    float related?
  • 0
    @hoggchan I wish I knew
  • 2
    Well in js -0 === 0 so aside of presentation I see no issue
  • 0
    i feel like this is a string error XD
  • 1
    Press the any key and see if the mistake repeats itself for different inputs.
  • 0
    gg dude, try some ji++ :^)
  • 0
    -0 is technically anything between 0 and -0.5...
  • 2
    In C++ -0 is completely okay result
    It is used in arithmetics, for instance: 1/0 == +infinity, 1/-0 == -infinity, pow(10, 1/-0) == 0, etc.
  • 0
    I guess that -0.004, for example, would be far to long for the output. So it's simply rounded but the - is kept because it was a negative number anyway. It also looks like some form of matrix manipulation where I had something similar happen at some point.
  • 0
    Someone's using U1? ^^
Add Comment