Skip to content

Repository files navigation

cicalc: C Interactive CALCulator

cicalc is an interactive calculator written in C. It can handle decimals due to it using double.

Running

Run cc -o nob nob.c, then run ./nob build to build it. This will generate a cicalc executable.

Installation

After following the steps in the above section, run ./nob install-sys as root to install system-wide or ./nob install-user to install as the user. You can view full usage of the build system by running ./nob with no arguments Note: If you install it as the user, you need to add $HOME/.local/share/man to your MANPATH.

Syntax

The syntax is OPERATOR [NUMBERS...]. However, you could use pi instead of directly using a number to use pi. You can use the following operators.

add

Add the numbers following this operator.

sub

Substract the numbers following this operator.

mul

Multiply the numbers following this operator.

div

Divide the numbers following this operator

nrt

Calculate the Nth root of the number following this operator. For example, nrt 4 2 to get the square root of 4, where 2 is N. Limitation: May not work with negative index if base is negative too

pow

Same as nrt, but it calculates the exponentiation of the number. For example, pow 2 2 to get 2 to the power of 2.

quit

Will quit cicalc.

Command-line usage

Run cicalc --help to view usage

Scripting

Just pipe a command into cicalc. A script file can also be provided as an argument.

Benefits over bc

Unlike bc, cicalc is a much simpler codebase and does not include a whole scripting language.

About

C Interactive CALCulator. Read-only mirror of https://codeberg.org/benja2998/cicalc

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages