From: Jonathan Wakely <jwakely@redhat.com>
To: Paul.Koning@dell.com
Cc: palves@redhat.com, gdb-patches@sourceware.org
Subject: Re: [PATCH] Implement floordiv operator for gdb.Value
Date: Tue, 20 Sep 2016 18:20:00 -0000 [thread overview]
Message-ID: <20160920171107.GE5736@redhat.com> (raw)
In-Reply-To: <1196FC25-F9EC-4A16-B675-19AA200E7B94@dell.com>
On 20/09/16 17:00 +0000, Paul.Koning@dell.com wrote:
>
>> On Sep 20, 2016, at 12:35 PM, Jonathan Wakely <jwakely@redhat.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)
>> 1
>> (gdb) python print (5.0/5.0)
>> 1.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.
next prev parent reply other threads:[~2016-09-20 17:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-20 13:34 Jonathan Wakely
2016-09-20 14:46 ` Jonathan Wakely
2016-09-20 15:41 ` Pedro Alves
2016-09-20 16:41 ` Jonathan Wakely
2016-09-20 16:42 ` Jonathan Wakely
2016-09-20 17:01 ` Pedro Alves
2016-09-20 17:11 ` Jonathan Wakely
2016-09-20 17:08 ` Paul.Koning
2016-09-20 18:20 ` Jonathan Wakely [this message]
2016-09-20 19:06 ` Paul.Koning
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160920171107.GE5736@redhat.com \
--to=jwakely@redhat.com \
--cc=Paul.Koning@dell.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox