RionaCalc

Mathematical expression calculator with big integers, floats, common fractions, and complex numbers support. It can be launched in two modes: immediate, when rclc gets an expression, calculates it, prints the result, and exits; and interactive, when rclc displays a prompt and calculates every expression you type.

Suggestions, ideas, pull requests are very welcome. Thank you!

Why yet another calculator

From time to time I need to evaluate an expression that contains values other than float point numbers: common fractions, complex numbers, arbitrary precision integer numbers. But majority of calculators works only with floating point numbers. Even if a calculator supports any of other types of numbers, it often requires switching to special modes. E.g, calculators that supported common fractions required to enter common-fraction mode to use them - in this mode other kinds of numbers are unavailable. Some calculators support complex numbers but do not do it transparently for a user. E.g, its documentation states that complex numbers are supported but a calculator fails on a evaluating square root of negative number with an error "Invalid argument". I wanted to have a calculator that allows me to mix any types of numbers in one expression and it is able to detect the correct type of the result and argument.

Lesser requirements:

Very simple examples(ans - an special variable that holds the result of the last successful evaluation):

```

sqrt(-2) // square root of negative number = 0.0+1.4142135623730952i sqr(ans) // square root of a complex number may produce real number = -2.0000000000000006 345**12 // big integer in action = 2843342266303054544082275390625 1\2 + 3\5 // one half and three fifth is one and one tenth = 1\1\10 sqr(3\5) // square of a rational number is a rational number = 9\25 sin(90°) == sin(pi/2) // degrees and radians mixed in one expression, '°' can be replaced with 'd' for easier typing = 1 ```

Features

Please, read the detailed documentation here.

Installation

The application can be compiled from source, or installed using cargo:

shell $ cargo install rclc

You need Rust compiler that supports Rust 2018 edition (Rust 1.31 or newer) to do it. If you want to upgrade existing rclc, execute the following command:

shell $ cargo install rclc --force

Pre-compiled binaries

For Windows you can download pre-compiled binaries from Release page.

Known issues