From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5912 invoked by alias); 12 Sep 2014 23:16:43 -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: 19077 Received: (qmail 23755 invoked from network); 12 Sep 2014 23:16: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: <140912161627.ZM23323@torch.brasslantern.com> Date: Fri, 12 Sep 2014 16:16:27 -0700 In-reply-to: <20140912084230.GA4226@linux.vnet.ibm.com> Comments: In reply to Dominik Vogt "Re: Determining the length of "long"?" (Sep 12, 9:42am) References: <20140911213608.GA1029@gmx.de> <140911213901.ZM21898@torch.brasslantern.com> <20140912084230.GA4226@linux.vnet.ibm.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: vogt@linux.vnet.ibm.com, zsh-users@zsh.org Subject: Re: Determining the length of "long"? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 12, 9:42am, Dominik Vogt wrote: } } On Thu, Sep 11, 2014 at 09:39:01PM -0700, Bart Schaefer wrote: } > if (( ${#:-"$(( [#2] (1<<31)))"} > ${#:-"$(( [#2] (1<<63)))"} )) } > then print "zsh integer type is 32 bits" } > elif (( ${#:-"$(( [#2] (1<<63)))"} > ${#:-"$(( [#2] (1<<64)))"} )) } > then print "zsh integer type is 64 bits" } > else print "zsh integer type is more than 64 bits" } > fi } } Hm, I'm not really sure that works reliably because the shift } amount may be truncated before it is used. I.e. on s390 "1 << 32" } and "1 << 64" and "1 << 0" are all the same. That probably means that zsh uses a 32 bit integer type on s390. There is a reason the shift in my "if" above is 1<<31 not 32.