Skip to content

smoli/stcalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stcalc

Expression evaluator

A little project to learn Rust. There are better, feature wise and from an implementation standpoint.

Usage

stcalc.exe [OPTIONS] [EXPRESSION]...

Arguments:
  [EXPRESSION]...

Options:
  -r, --repl      REPL mode
  -i, --input     Show only input
  -q, --equation  Show as equation
  -h, --help      Print help information
  -V, --version   Print version information

Features

It can use decimal numbers, positive and negative. Computations are internally done as a 64bit floating point number.

Operator Effekt
+ Addition
- Subtraction
* Multiplication
/ Division
** power of
^ power of

Espanso Integration

In day to day use I use it within espanso. E.g. add this to your .yaml:

  - regex: ":=\\((?P<input>.*)\\)"
    replace: "{{solved}}"
    vars:
      - name: "solved"
        type: "shell"
        params: 
          cmd: "stcalc %ESPANSO_INPUT%"
          shell: "cmd"   

This will turn :=(12 + 23) into 35.

License

License: MIT

Also here

About

Expression evaluator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages