zsh-users
 help / color / mirror / 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

zsh-users

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-users

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-users zsh-users/ http://inbox.vuxu.org/zsh-users \
		zsh-users@zsh.org
	public-inbox-index zsh-users

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.users


code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git