What is wrong with the fact that I ask GDB to print?
This seems to be a bug with gdb.
Negative floating point hexadecimal constants give wrong result with gdb.
I tried with the latest initial release of gdb 7.9 (February 20, 2015) on Linux and hexadecimal floating point constants with a positive exponent are supported:
(gdb) p/f 0x00.1p0 $1 = 0.0625 (gdb) p/f 0x00.1p1 $2 = 0.125
but if the indicator is negative, then the result is incorrect:
(gdb) p/f 0x00.1p-1 $3 = -0.9375
The correct and expected result is 0.031250 .
source share