Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zcalc



> 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