From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11015 invoked by alias); 19 Feb 2008 20:47:52 -0000 Received: (qmail 11006 invoked by uid 22791); 19 Feb 2008 20:47:52 -0000 X-Spam-Check-By: sourceware.org Received: from ns2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 19 Feb 2008 20:47:32 +0000 Received: from Relay2.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id D3B5037EAD; Tue, 19 Feb 2008 21:47:29 +0100 (CET) From: Andreas Schwab To: "Dave Korn" Cc: "'Sheng-Liang Song'" , "'Bin Chen'" , "'Eli Zaretskii'" , Subject: Re: (len % 1) != 0 References: <5800c1cc0802162157g3ac31acas4ae95585b9b2e263@mail.gmail.com> <5800c1cc0802170641g68ab2e5fte724cd076412333@mail.gmail.com> <20080217152625.GA4810@caradoc.them.org> <47BB03ED.5060708@baymicrosystems.com> <007f01c87324$00f45a90$2e08a8c0@CAM.ARTIMI.COM> X-Yow: Yow! Date: Tue, 19 Feb 2008 21:41:00 -0000 In-Reply-To: <007f01c87324$00f45a90$2e08a8c0@CAM.ARTIMI.COM> (Dave Korn's message of "Tue\, 19 Feb 2008 18\:19\:44 -0000") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00146.txt.bz2 "Dave Korn" writes: > On 19 February 2008 16:30, Sheng-Liang Song wrote: > >> or >> >> (len & 1) != 0 <=> (len % 2) != 0 >> > > That would have the advantage of not requiring a divide operation :) The divide operation is already required and can be combined with the modulo operation. And this is by no means performance critical. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "Premature optimization is the root of all evil."