Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

calc — Simple Rust Calculator

Usage:

Run REPL:

cargo run

Quick calculation:

cargo run -- 3 + 4
# prints: = 7

In the REPL type exit or quit to leave. Supported operators: +, -, * (or x), /.

New operators:

  • % : modulo (remainder)
  • ^ or pow : power (exponent), e.g. 2 ^ 3 -> 8

Examples:

cargo run -- 12 % 5
cargo run -- 2 ^ 8

REPL improvements:

  • Line editing and history via rustyline.
  • History is saved to calc_history.txt in the current directory.

Try the REPL and use the up/down arrows to navigate past commands.

About

Copilot AI generated CLI calculator

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages