Usage:
Run REPL:
cargo runQuick calculation:
cargo run -- 3 + 4
# prints: = 7In the REPL type exit or quit to leave. Supported operators: +, -, * (or x), /.
New operators:
%: modulo (remainder)^orpow: power (exponent), e.g.2 ^ 3->8
Examples:
cargo run -- 12 % 5
cargo run -- 2 ^ 8REPL improvements:
- Line editing and history via
rustyline. - History is saved to
calc_history.txtin the current directory.
Try the REPL and use the up/down arrows to navigate past commands.