7 stable releases

1.3.0 May 25, 2025
1.2.1 Apr 10, 2025
1.1.1 Mar 18, 2025
1.0.4 Mar 6, 2025
1.0.3 Mar 5, 2025

#362 in Command line utilities

GPL-3.0-only

36KB
867 lines

Helix Calc is a simple Reverse Polish Notation calculator.

It's written in Rust, using Ratatui for the cross-platform interface and bigdecimal-rs for the internal operations.

The name is inspired by Helix Editor, and the functionality by the venerable GNU dc.

This is a toy app that fulfills my personal needs, but I'm open to PR :)

Operations

  • +, -, *, / : perform the arithmetic operation on the top two values.
  • % : compute the modulo of the second value divided by the first.
  • ^ : raise the second value to the power of the first.
  • P : pop the top value off the stack.
  • d : duplicate the top value.
  • v : compute the square root of the top value.
  • k : pop the top value and use it to set the precision.
  • r : swap the first two values.
  • [Up]: edit the value at the top of the stack.

Negative numbers

Two options to enter them:

  • Type them as _123.
  • Type them as 123- (careful, no space).

Limitations

By default, BigDecimal is compiled with a max precision of 100 digits: beyond that size, decimal places will be dropped, even if the integer part can handle much larger numbers.

Dependencies

~10–20MB
~305K SLoC