From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLvNt-0003eW-Nn for qemu-devel@nongnu.org; Wed, 20 Jan 2016 11:13:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLvNp-0004Dp-Og for qemu-devel@nongnu.org; Wed, 20 Jan 2016 11:13:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLvNp-0004Dl-J4 for qemu-devel@nongnu.org; Wed, 20 Jan 2016 11:13:21 -0500 References: <1452761307-57200-1-git-send-email-frankja@linux.vnet.ibm.com> <5697CBB7.4070805@redhat.com> <20160118163112.GI4075@hawk.localdomain> <569D2797.7010605@redhat.com> <569F5B89.3070103@linux.vnet.ibm.com> <569F70B2.9030201@redhat.com> <8737tsweb0.fsf@blackfin.pond.sub.org> From: Laszlo Ersek Message-ID: <569FB21E.6050906@redhat.com> Date: Wed, 20 Jan 2016 17:13:18 +0100 MIME-Version: 1.0 In-Reply-To: <8737tsweb0.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 0/5] scripts/dump-guest-memory.py: Add multi-arch support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Paolo Bonzini Cc: Janosch Frank , Andrew Jones , qemu-devel@nongnu.org On 01/20/16 14:50, Markus Armbruster wrote: > Paolo Bonzini writes: > >> 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 > > The latter is *far* easier on my eyes. But you'd still have to truncate > for Python 3. Yes, I think I had (len_desc + 3) // 4 in mind (except I didn't know about "//" just yet :)) Thanks Laszlo