From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17500 invoked by alias); 8 Feb 2018 12:58:29 -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: List-Unsubscribe: X-Seq: 42347 Received: (qmail 24843 invoked by uid 1010); 8 Feb 2018 12:58:28 -0000 X-Qmail-Scanner-Diagnostics: from out2-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.26):SA:0(-2.6/5.0):. Processed in 2.378638 secs); 08 Feb 2018 12:58:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=9DFcFg RD2pczQltdrfobZb5Hbmb4ODmZJoXJSRJBYiY=; b=IPenxKncs00woaU3LLyeUT SfZNbhVg1t2ycMzF4wp2OaawSttguM+FGFu+7v9n9s0yLXTlubijfONE35d7NRZ7 zpGiFp1jubh5KoZIz39e27OZ5DWgRBLdXd5eYYSoIUbz8VNV/kLYUYJDIy7f67qg l0UPTiSbDSwF/2L/ad604LB8+wbfqfsiMqKhL6i73p4wzN1d1z2iRqtjhmicdrXM 9mBkn88OK9jDSVjA6VmrWkOKK/QwT0522Evap4/ghh05sYq6fHxJQUvaW/TnLVtx ZmAYzT+MjW9wBZP1UHGz1tCPLr3DCg6k/RmPGb5eKN0Yl2xME8IftZcwuXBQY/tA == DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=9DFcFg RD2pczQltdrfobZb5Hbmb4ODmZJoXJSRJBYiY=; b=nyiYMBy3B0ienKcdXIsSlJ sgP+g7Y83pNxmRBKS7xejlbSKn+4eI++jFvKrWRkQ00JwV6PscEwJSXntk0dkQ1X PpB2GWDkQrtVUW+OGq9M4/y8WriQHvQGvgTWKwvVLz62Zvp7F0QUycuiCdA7QVVc 8+Vs2zHomE65ngQ4jrVzB6XOTmN/7RY4udGYCLiyKF6Wq5NA4HhKo/yTNgUCxc3I GOVEIm795OLpCpCBzgamm46Ug2Hqk3QbFeyG0x5SRBlKdB9j3UOhftmFc97o/KVD Hg7QIEPriD01eE3X1EBU+L/fa1OTjaU4kECT8OtZ4Z9ybmnfZqtDMZyCi3CiN5Gg == X-ME-Sender: Message-Id: <1518093995.645366.1263935336.265ED7BF@webmail.messagingengine.com> From: Daniel Shahaf To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fde26eb3 Subject: Re: inf and nan in arithmetic expansions References: <20180207223051.GA30393@chaz.gmail.com> <4253.1518045946@thecus.kiddle.eu> In-Reply-To: <4253.1518045946@thecus.kiddle.eu> Date: Thu, 08 Feb 2018 12:46:35 +0000 Oliver Kiddle wrote on Thu, 08 Feb 2018 00:25 +0100: > > neither "inf." nor "inf" are understood in arithmetic > > expressions (and for "inf.", nor by other tools like awk, or > > even the builtin printf): > > > It should be safe to change zsh so that inf. (and Inf. INF. NAN. > > nan., maybe also Infinity.) are recognised in arithmetic > > expression, as it's currently invalid, but that leaves the > > problem of "inf." not being recognised by other tools > > (awk/printf). > > There was actually a patch posted back in workers/19597 to do this. I > don't know why it never got integrated other than that a certain > amount of integration work was perhaps required. Why do we generate "inf." with a period in the first place? I know of no other tool that does this. Shouldn't we generate "inf" and "nan" with no period? And then we could add 'inf' and 'nan' as readonly variables initialised to those respective values (as Oliver also suggests in the 19597 thread). There are compatibility implications for scripts that use these variable names, but there is no way around them if we want to allow explicitly doing (( x = inf )) in user code... Cheers, DAniel