From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9983 invoked by alias); 29 Apr 2013 02:07:11 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31352 Received: (qmail 19462 invoked from network); 29 Apr 2013 02:07:09 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.212.180 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:subject:message-id:mail-followup-to :mime-version:content-type:content-disposition:user-agent; bh=JPsBoO6F9ttomp9cPBeVOECwR3Xn6PuWsXBdLaA3t54=; b=XvKiKqU4XeccdF9L/dy+rw0qnF82LQUdzXctvG5ZAGdqiE/pr1PwkgSkc7ZObmBt8v AbM4Ry3SifBdnZfpK+ZyXLdhYYFY6m3i6CKmYO3qlWCRT3e/eD6hBRNa7iixnMLonywx i3hoWZ2cCs11A/5KuTmnrtnIZ6ro/XibnirsAapnSL5T9OuTd25I2oV7e2ducgwUMhxw Gk0NS0io8hDtCJMRWl3frakKHDENOYArVZdm9IDkCX+kTqw1sVWl2NzU9kK660V646DF en4TU+hdMjoBgPSs80BtN8zWfu6RQrY5fG1JJBAPLf0xvLzTdxcFN0J++Vaod1NE0v9g kUCQ== X-Received: by 10.194.119.202 with SMTP id kw10mr19940947wjb.26.1367200804286; Sun, 28 Apr 2013 19:00:04 -0700 (PDT) Date: Mon, 29 Apr 2013 03:00:02 +0100 From: Stephane Chazelas To: Zsh Hackers' List Subject: [bug] $((0.5?1+1:3)) Message-ID: <20130429020002.GA7626@chaz.gmail.com> Mail-Followup-To: Zsh Hackers' List MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Hello, That's quite an odd one. For any value of x between -1 and 1 (-1, 1 and 0 excluded), $(( x ? : 42 )) where is anything but a numeric constant, expands to "0". OK$ echo $((0.5?2:3)) 2 NOK$ echo $((0.5?1+1:3)) 0 OK$ echo $((1.1?2:3)) 2 $ echo $ZSH_VERSION 5.0.2 (debian 7 amd64) Work around is to write it $(( 0.5 != 0 ? 1+1 : 3 )) (since 0.5 != 0 then has a value of 1 which falls outside that range I suppose). regards, Stephane