zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-users@zsh.org
Subject: Re: zcalc
Date: Mon, 19 Oct 2020 17:44:15 +0100 (BST)	[thread overview]
Message-ID: <633218154.689035.1603125855377@mail2.virginmedia.com> (raw)
In-Reply-To: <20201019091329.4674@binki>


> On 19 October 2020 at 17:13 jdh <dhenman@gmail.com> 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


      reply	other threads:[~2020-10-19 16:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 16:13 zcalc jdh
2020-10-19 16:44 ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=633218154.689035.1603125855377@mail2.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).