I was just using gdb to print out a value of a double and to my surprise it printed -0
What is a double of -0 value mean in C?
By the way when I checked it’s equality with 0 it returned true: To do the comparison I just did the following
in gdb
> print some_double -0 > print some_double == 0 1
Negative zero is a useful concept for numerical computing and is a valid floating point number in C.