zsh-users
 help / color / mirror / code / Atom feed
* zcalc
@ 2020-10-19 16:13 jdh
  2020-10-19 16:44 ` zcalc Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: jdh @ 2020-10-19 16:13 UTC (permalink / raw)
  To: zsh-users


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.

Thanks

---------

   


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: zcalc
  2020-10-19 16:13 zcalc jdh
@ 2020-10-19 16:44 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2020-10-19 16:44 UTC (permalink / raw)
  To: zsh-users


> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-19 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19 16:13 zcalc jdh
2020-10-19 16:44 ` zcalc Peter Stephenson

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).