GithubHelp home page GithubHelp logo

eva's Introduction

heroimg.png

eva

simple calculator REPL, similar to bc(1), with syntax highlighting and persistent history

eva.png

installation

  • crates.io
$ cargo install eva
  • manual
$ git clone https://github.com/nerdypepper/eva.git
$ cargo run

usage

eva 0.2.4
NerdyPepper <[email protected]>
Calculator REPL similar to bc(1)

USAGE:
    eva [FLAGS] [OPTIONS] [INPUT]

FLAGS:
    -h, --help       Prints help information
    -r, --radian     set eva to radian mode
    -V, --version    Prints version information

OPTIONS:
    -b, --base <RADIX>    set the radix of calculation output (2, 8, 10, 16 etc.)
    -f, --fix <FIX>       set number of decimal places in the output

ARGS:
    <INPUT>    optional expression string to run eva in command mode

type out an expression and hit enter, repeat.

> 1 + sin(30)
1.5
> floor(sqrt(3^2 + 5^2))
5
> 5sin(45) + cos(0)
4.53553

updating

  • crates.io
$ cargo install eva --force
  • manual
$ cargo install --force --path /path/to/eva

operators

  • binary operators: + - * / ^
  • unary operators: + -

constants

some constants avaliable in rust standard library.

e      pi

examples:

pi * 5^2  # πr²

functions

all trignometric functions expect input in degrees.

sin    cos     tan    csc    sec    cot    sinh   cosh   tanh
asin   acos    atan   acsc   asec   acot   ln     log    sqrt
ceil   floor   abs

deg(x) - convert x to degrees
rad(x) - convert x to radians

examples:

sqrt(sin(30)) # parentheses are mandatory for functions

log100        # no
log(100)      # yes

quality of life features

  • auto insertion of * operator
>12sin(45(2))             # 12 * sin(45 * (2))
12
  • auto balancing of parentheses
>ceil(sqrt(3^2 + 5^2      # ceil(sqrt(3^2 + 5^2))
6
  • super neat error handling
> 1 + ln(-1)
Domain Error: Out of bounds!
  • syntax highlighting

todo

  • add support for variables (pi, e, _ (previous answer))
  • syntax highlighting
  • multiple arg functions
  • screenshots
  • create logo
  • unary operators (minus, plus)
  • add detailed error handler
  • add unit tests
  • lineditor with syntax highlighting
  • add more functions

contributors

the rust community has helped eva come a long way, but these devs deserve a special mention for their contributions:

Ivan Tham
Milan Marković
asapokl

eva's People

Contributors

equal-l2 avatar hepek avatar jcgruenhage avatar nerdypepper avatar pickfire avatar thesuess avatar vlamai avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.