From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16148 invoked by alias); 13 Sep 2014 00:17:52 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19080 Received: (qmail 26384 invoked from network); 13 Sep 2014 00:17:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140912171737.ZM23818@torch.brasslantern.com> Date: Fri, 12 Sep 2014 17:17:37 -0700 In-reply-to: <20140912234254.GA30434@gmx.de> Comments: In reply to Dominik Vogt "Re: Determining the length of "long"?" (Sep 13, 12:42am) References: <20140911213608.GA1029@gmx.de> <140911213901.ZM21898@torch.brasslantern.com> <20140912084230.GA4226@linux.vnet.ibm.com> <140912161627.ZM23323@torch.brasslantern.com> <20140912234254.GA30434@gmx.de> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Determining the length of "long"? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 13, 12:42am, Dominik Vogt wrote: } Subject: Re: Determining the length of "long"? } } To clarify, on s390 (1 << 31) has the same result as (1 << 63) *if* } the integer type is long (which I doubt, zsh probably uses long } long). Indeed, I wasn't aware (more accurately, forgot) that s390 has those oddball 31-bit integers. } The underlying assumption of the test that shifting an integer } value to the left by its width in bits or more yields zero is } wrong on some platforms. That's not the underlying assumption, acctually. The assumption is that shifting by (number of bits minus one) will yield a very long binary number (the ${#:-"..."} in the test: lots of trailing zeroes), whereas shifting by the number of bits or more yields a number with a smaller footprint because multiple leading zeroes are not printed.