#term #utility #terminal #cli

app ca

Arbitrary precision calculator REPL

2 releases

Uses old Rust 2015

0.1.1 Jul 12, 2017
0.1.0 Jul 12, 2017

#78 in #term

MIT license

16KB
558 lines

ca

ca is an arbitrary precision calculator. It can do simple linear math with fully accurate results, and exposes this with a simple REPL.

Features

  • Basic operators (+ - * / % ^ =)
  • No loss of precision, accurate representation of repeating decimals
  • Implicit multiplication (adjacent products) with incorrect precedence
  • Variables and variable binding (a := 2b, b := .5)
  • Partial evaluation, leaving unknowns and recursive definitions in place
  • Partial Unicode glyph support
  • Function application with or without parens (floor 3.5)
  • An incomplete set of functions (floor, ceil, round, trunc, fract, abs)
  • Half-baked functionality: sets (like (1,2,3) or ())

Guide

To try ca, just clone the repository and run cargo run with Rust stable:

$ git clone https://github.com/qoh/ca
$ cd ca
$ cargo run

Contributing

Please and thanks.

Dependencies

~2.5MB
~55K SLoC