From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3753 invoked from network); 19 Oct 2020 16:44:48 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Oct 2020 16:44:48 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1603125888; b=R0o3UVOX7RNzja47HU3hbtFN54mCTK/gYaR2StPfvYy3RwrdL0JWpv8t6HVUDWgSYHIevn1PS7 ADiqZbVZtLR25tTZ8AUavvtC7gK+NHEh+WFpMe64Nc9/mNk+02FMRNYo+gnN0mQYcMgIHEZDkv q28R6MCBrg8WH9T6yYYPvAJjPS4DEZamAMqDo/VERrsrcMXglpAQ0UnQ/jVyN1GMle3Q3QdNB8 3MZp3sUrdZUquUnJWxVhM/kWpTR21YA2Yzr+v61mMQjyZH05OlNy3mLLoGG39DHBmJCV6lEMSU iPjrFfLQHsLqsbOT91WapKhc+3DbOLmhpm/JTveQuI8LWA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1603125888; bh=hPh1lbBPZytmPTjXwEkEDjH43evuWRDoUA4WDOeMHmQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=N1bQhplt0LdSNAAsBZLBEGGdqeJjyOfHr4Tz1jeqSSdIshwXX1A8xEu9B4UQs4pHg8uYsg2jhv b1So6R7az7kuK1b8qExCbiXQ5LyecuNC3w/Xi/k5D0z36BhYTLzbiWHUYAmYPbSPOFSsANjHjT WkVs6YwY2wEGEvqVCLxkIQzNgrn7bkeVnMipALtB/LOGeQCSKe+WLjeqmEbHHsnj9UAVVsQ0J0 qz+Vbiyb0DtPYuYHC84L4FrGAPhhc77papppFHqreLo77k2zlx15I/iAP0ucrL0pjbFB2C/xmc j7s9jOTRQftbgUH1WGKvRyxY4v7Fds7B2hx+lO578bTPmg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=1h2eQdIGAmCQslvXcCxQiHMX9dVUGLD6aeI6J5L+lc4=; b=E5piHBZh9rYKYHBH0Ju7xX81aP 4QaPq1AtjRu56FtylNNic6hxmvPhlDV53L4f2LHRigksr1U5H89XofC6aEQtT8Dps8SFORyEvDCik +F1TUG6tYLqnLfiAWlWTH1yoZU1TSPA+9ENxPGG220M/jPQEUg9GN0i6j1Ar2rV4yMEQ4WlCE7o5y YRTVFeazx8mN6q5evVcnus2Ja6f1DUQ9pmChOD/MkDjP5t5gi4R2BI62Wc8ig8lO2B8GVex/VEte1 Kgx+K5/UKrNFlBkyi4BzUSbcuLatKY6pYHKytn2NOK9aj4qAIhbI7zDbKHXTQYkNE0sJxRLsTZuhQ +N9cW3/g==; Received: from authenticated user by zero.zsh.org with local id 1kUYH5-000Ch3-Rd; Mon, 19 Oct 2020 16:44:43 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq1.tb.ukmail.iss.as9143.net ([212.54.57.96]:45706) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1kUYGf-000CK4-0M; Mon, 19 Oct 2020 16:44:17 +0000 Received: from [212.54.57.81] (helo=smtp2.tb.ukmail.iss.as9143.net) by smtpq1.tb.ukmail.iss.as9143.net with esmtp (Exim 4.86_2) (envelope-from ) id 1kUYGd-0007uU-L3 for zsh-users@zsh.org; Mon, 19 Oct 2020 18:44:15 +0200 Received: from oxbe4.tb.ukmail.iss.as9143.net ([172.25.160.135]) by smtp2.tb.ukmail.iss.as9143.net with ESMTP id UYGdkPnUgMKXXUYGdkcfvv; Mon, 19 Oct 2020 18:44:15 +0200 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-users@zsh.org X-SourceIP: 172.25.160.135 X-CNFS-Analysis: v=2.4 cv=askMtQVV c=1 sm=1 tr=0 ts=5f8dc25f a=4Y6ZOpbT0QVQcxr4UWay9g==:117 a=KEnZaF_ea6UA:10 a=IkcTkHD0fZMA:10 a=DoY9bV0jb9AA:10 a=pGLkceISAAAA:8 a=O_0Zlgtm0wOp0v9EuVAA:9 a=QEXdDO2ut3YA:10 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1603125855; bh=hPh1lbBPZytmPTjXwEkEDjH43evuWRDoUA4WDOeMHmQ=; h=Date:From:To:In-Reply-To:References:Subject; b=PR+QbbJxP22PfVJE4eKW8lmaFRVlTq2B6XqymhCHScpBxDrJ10xD0OmO3vrDyv+DJ FgmWuuMPT9r7y0fzG5HpFcfdCleP8Ixa1LfyvTpDt+j1xYOIaQ6XIY7bvMuYVcpj+V QArhFkuNZ0jYAVoYUArT9BwVWoM/Tz6Qrt9F/rvH/8tI8Lqqz8WGmZzsSh9mbziRYd UgKSBjLavuuhfakKuyeaMahrg4+r9S0CwoZcGPOEXo/v3SIsd2r5cbK7FP+o4u1noU DWZrb5lvULHDFCHWuIajxWXUrshyyRjcDOeZsiy+r1SMfm8xxQFhoNZXogfKqVrQuF onaESk/iw1eRQ== Date: Mon, 19 Oct 2020 17:44:15 +0100 (BST) From: Peter Stephenson To: zsh-users@zsh.org Message-ID: <633218154.689035.1603125855377@mail2.virginmedia.com> In-Reply-To: <20201019091329.4674@binki> References: <20201019091329.4674@binki> Subject: Re: zcalc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev72 X-Originating-IP: 165.225.81.56 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfGfHTGfML7RPjlR1WU9gnKBGCSZtlv3VXjESUoMrRrc5ZVBqcSKNsU7rqgJdp8fg0c39VS9OZbg4zr7KCttXmv1/IJMybRNGZbhK2DgJ6RfUwvZdWAPu BhF3/Jn7yFRnIqHkU8lSLX965JBy75WcfPu4OVydprmfOSOw8QVpR7cOxKhXWwhqXW90GWWXItRR3N75wZURXy8gxHAqdQurMCIY0AQZk4pyCvL72ORMwF18 X-Seq: 26117 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: > On 19 October 2020 at 17:13 jdh wrote: > Is there a definition on the "/.zcalcrc file syntax? > > For example how does one put in the -f (use floating point calculations) into it. > Also possible add constants that I frequently use in zcalc only, etc. It's just normal shell code. One point worthy of note is that it's within an "emulate -L zsh", so you can put in any option settings that will only apply within the function. You can add stuff like float myfloat=3.19824 Each line in zcalc is evaluated separately as a $(( ... )) expression --- so it determines each time if each value is a floating point or integer. For floating point just make sure there are decimal points on the numbers. But if you want you can setopt force_float in the initialisation file. pws