Usbac / quich

Just an advanced terminal calculator.
MIT License
71 stars 12 forks source link
c calculator cli math



Quich

Just an advanced terminal calculator.

Quich is a compact, fast, powerful and useful calculator for your terminal with numerous features, supporting Linux, Mac and Windows, written in ANSI C.

You can enter in interactive mode by calling Quich in your terminal without an operation.

Usage

Options

-d --degree Manage the given angles in degrees

-f --format [%s] The format to display the result

-h --help Get help and information

-i --interactive Force interactive mode

-p --precision [%i] The number of decimals to be used for the internal numbers

-r --round [%i] The number of decimals to round the result

-t --thousands Display the result with thousands separators

-vvv --verbose Display the result with details

-v --version Show the application version

Functions

Syntax: func(operand)

Variables

For defining a variable just write an equal operator between its name and its value. Like this: a=4+20.

Available

Values PI, E, GR (Golden Ratio) and G (earth gravity).

The units of measurement for data storage mb, gb, tb and pt (they return the result in kb).

Install

Packaging status

You can download the bundles here.

Or move to your Quich folder and run the following command:

make && sudo make install

Now you should be able to access Quich by running quich in your terminal.

Naming

You can specify the Quich name when installing it with the NAME makefile variable:

sudo make install NAME=calc

Now you will be able to access Quich with the calc command.

Testing

Move to your Quich folder and run the following command:

make test && ./quich_test

Examples

$ quich 5+3
8
$ quich "a=20;a+1"
21
$ quich "5+(cos(2)-2)^2"
10.8377655357568
$ quich "5+(cos(2)-2)^2" -p 2
10.86
$ quich 1234567+1 -t
1,234,568
$ quich 1gb+1mb
1049600
$ quich 12345 -f '%.1g'
1e+04
$ quich 5+PI -vvv
Tokens > '5' '+' 'PI'
Posfix > 5 PI +
Result > 8.14159265358979

Contributing

Any contribution or support to this project in the form of a pull request or message will be highly appreciated. ❤️

You can read more about it right here. Don't be shy :)

License

Quich is open-source software licensed under the MIT license.