Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
OrestH7518yIn 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. -
Tungdil28yI 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.
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
-
sam966911Hats off to this lady .... I would have just flipped the machine
You know your code is broken when it outputs -0....
undefined
c++