This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] Implement floordiv operator for gdb.Value
On 20/09/16 17:00 +0000, Paul.Koning@dell.com wrote:
On Sep 20, 2016, at 12:35 PM, Jonathan Wakely <email@example.com> wrote:
This seems to be an existing property of gdb.Value, as even using the
normal division operator (and without my patch) I see floats printed
without a decimal part when they are an integer value:
(gdb) python print (gdb.Value(5.0)/5.0)
(gdb) python print (5.0/5.0)
In all this, please keep in mind that this is one place where Python 2 and Python 3 differ:
Right, see https://sourceware.org/ml/gdb-patches/2016-09/msg00221.html
for a crazy idea that would make gdb.Value match the Python version
it's built against.
That wouldn't help for Python 2 using __future__ division though.