List Info

Thread: BINOP_DIV and ptyp command




BINOP_DIV and ptyp command
country flaguser name
France
2008-01-21 03:47:36
The ptyp command returns inconsistent types for the c
'/'(BINOP_DIV)
operator:

(gdb) ptyp 3 / 2
type = int
(gdb) p 3 / 2
$4 = 1
(gdb) ptyp 3.0 / 2
type = double
(gdb) p 3.0 / 2
$5 = 1.5
(gdb) ptyp 3 / 2.0
type = int
(gdb) p 3 / 2.0
$6 = 1.5

I suspect that this bug is due to the fact that
the type of this binary operator is inferred from the
left node type, but this is wrong in the case '3 / 2.0'


Pierre Muller



[1]

about | contact  Other archives ( Real Estate discussion Medical topics )