All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Janosch Frank <frankja@linux.vnet.ibm.com>,
	Laszlo Ersek <lersek@redhat.com>,
	Andrew Jones <drjones@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC 0/5] scripts/dump-guest-memory.py: Add multi-arch support
Date: Wed, 20 Jan 2016 12:34:10 +0100	[thread overview]
Message-ID: <569F70B2.9030201@redhat.com> (raw)
In-Reply-To: <569F5B89.3070103@linux.vnet.ibm.com>



On 20/01/2016 11:03, Janosch Frank wrote:
> 
> In python 3:
> 1/2 == 0.5
> 1//2 == 0
> but a // b == floor(a/b), i.e. a cast is made.
> 
> Anyway, I got rid of the import with:
> -(-len_desc // 4)

I would change that to either:

    def ceil_div(a, b)
        return -(-a // b)

    ...

    ceil_div(len_desc, 4)

or

    (len_desc + 3) / 4

Paolo

  reply	other threads:[~2016-01-20 11:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14  8:48 [Qemu-devel] [RFC 0/5] scripts/dump-guest-memory.py: Add multi-arch support Janosch Frank
2016-01-14  8:48 ` [Qemu-devel] [RFC 1/5] scripts/dump-guest-memory.py: Move constants to the top Janosch Frank
2016-01-14  8:48 ` [Qemu-devel] [RFC 2/5] scripts/dump-guest-memory.py: Make methods functions Janosch Frank
2016-01-14  8:48 ` [Qemu-devel] [RFC 3/5] scripts/dump-guest-memory.py: Improve python 3 compatibility Janosch Frank
2016-01-14 16:03   ` Laszlo Ersek
2016-01-15 10:05     ` Janosch Frank
2016-01-20 11:18   ` Paolo Bonzini
2016-01-20 13:02     ` Janosch Frank
2016-01-14  8:48 ` [Qemu-devel] [RFC 4/5] scripts/dump-guest-memory.py: Cleanup functions Janosch Frank
2016-01-14 16:11   ` Laszlo Ersek
2016-01-14  8:48 ` [Qemu-devel] [RFC 5/5] scripts/dump-guest-memory.py: Introduce multi-arch support Janosch Frank
2016-01-14 16:24 ` [Qemu-devel] [RFC 0/5] scripts/dump-guest-memory.py: Add " Laszlo Ersek
2016-01-18 16:31   ` Andrew Jones
2016-01-18 17:57     ` Laszlo Ersek
2016-01-20 10:03       ` Janosch Frank
2016-01-20 11:34         ` Paolo Bonzini [this message]
2016-01-20 13:50           ` Markus Armbruster
2016-01-20 16:13             ` Laszlo Ersek

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=569F70B2.9030201@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=drjones@redhat.com \
    --cc=frankja@linux.vnet.ibm.com \
    --cc=lersek@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.