~ariadnavigo/scalc

Simple calculator
op.c: log10 operation added
op.c: bitwise and, or, xor, not added.
README.md: fixed typo

clone

read-only
https://git.sr.ht/~ariadnavigo/scalc
read/write
git@git.sr.ht:~ariadnavigo/scalc

You can also use your local clone with git send-email.

#scalc - Simple calculator

scalc is a very simple stack-based calculator that aims to be small.

#Basic usage

scalc presents the user with an interactive prompt. Operations are written in Reverse Polish Notation and values are stored in a stack. Supported operations include basic arithmetics, logarithms, trignometry, etc. scalc also supports commands that modify the behavior of the stack and scalc itself.

$ scalc
> 1 2 +
3.000000000
> 4
4.000000000
> +
7.000000000
> 2 / 18 +
21.500000000
> ln
3.068052935
> :quit

You may check the scalc(1) manpage for further usage information.

#Build

scalc is supported on Linux and OpenBSD, and requires:

  1. A C17 compiler
  2. sline 3.0+
  3. scdoc: to generate the manpage.

Build by using:

$ make

Customize the build process by changing config.mk to suit your needs.

User configuration is performed by modifying config.h. A set of defaults is provided in config.def.h.

#Install

You may install scalc by running the following command as root:

# make install

This will install the binary under $PREFIX/bin, as defined by your environment, or /usr/local/bin by default. The Makefile supports the $DESTDIR variable as well.

#Contributing

You're very welcome to contribute with patches and discussion by sending an email to ~ariadnavigo/scalc-devel@lists.sr.ht. You may want to check out the scalc tracker to see where the work is being done right now.

You may stay up-to-date for news about the project by subscribing to the ~ariadnavigo/scalc-announce@lists.sr.ht mailing list as well.

#License

scalc is published under the MIT License. See LICENSE file for copyright and license details.