A command-line front-end for libabacus written in C++
Go to file
Danila Fedorin 3c949c9ed3 Create a more clear boundary between "library" and "client"
Even though "abcs" is technically a front-end for
libab, what it does is fill in some blanks left available by
it. However, I'm keeping most of this "fill-in-the-blanks"
code standalone, so that it may be used in other projects.
2018-08-31 23:27:20 -07:00
external Update libabacus. 2018-08-22 17:47:48 -07:00
include Create a more clear boundary between "library" and "client" 2018-08-31 23:27:20 -07:00
src Create a more clear boundary between "library" and "client" 2018-08-31 23:27:20 -07:00
.gitmodules Initial commit. Add submodules. 2018-08-14 01:03:22 -07:00
CMakeLists.txt Remove use of pkg-config: readline already depends on local install. 2018-08-22 00:00:27 -07:00
README.md Update README. 2018-08-20 00:22:17 -07:00

abcs

A libabacus front end for the command-line.

Syntax

Please see the libabacus documentation (external/libabacus/README.md) for a guide through the syntax.

Implementation

abcs uses GNU MPFR for its number implementations. It keeps 200 digits of precision, and displays up to 50. By default, 3 digits are displayed. The request_precision function can be used to request more digits to be displayed.

RC File

abcs loads, by default, an .abcsrc file in the same directory in which it is run. It parses the whole file ingoring newlines and spaces, and evaluates it in order. The RC file can be used to specify constants or declare functions that the user wants to re-use between sessions.

Provided Functions and Operators

Operator Function Precedence
< lt 1
<= lte 1
== equals 1
> gt 1
>= gte 1
+ plus 2
- minus 2
* times 3
/ divide 3
^ pow 3
- negate (prefix)
! factorial (postfix)
Function Description
lt less than comparator.
lte less than or equal comparator.
equals equality comparator.
gt greater than comparator.
gte greater than or equal comparator.
plus addition function.
minus subtraction function.
times multiplication function.
divide division function.
pow exponentiation function
negate flip sign of number.
factorial factorial via the gamma function.
ln natural logarithm function.
exp e to the nth power function.
sqrt square root function.
sin trigonometric sine function.
cos trigonometric cosine function.
tan trigonometric tangent function.
arcsin trigonometric inverse sine function.
arccos trigonometric inverse cosine function.
arctan trigonometric inverse tangent function.
quit quits the REPL.
request_precision requests the given number of digits to be displayed in the REPL.