Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zcalc
- X-seq: zsh-users 26117
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: zcalc
- Date: Mon, 19 Oct 2020 17:44:15 +0100 (BST)
- Archived-at: <https://zsh.org/users/26117>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2020-10/633218154.689035.1603125855377%40mail2.virginmedia.com>
- 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
- 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==
- Importance: Medium
- In-reply-to: <20201019091329.4674@binki>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-users>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-users.zsh.org>
- List-owner: <mailto:zsh-users-request@zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-users>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-users>
- References: <20201019091329.4674@binki>
- Sender: zsh-users-request@xxxxxxx
> On 19 October 2020 at 17:13 jdh <dhenman@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author