Skip to content

w15eacre/study-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

study-rust

Learning the Rust programming language

This repository is dedicated to exploring and practicing Rust through small projects.

πŸ“Œ Project 1: Calculator

The first project is a simple calculator.
It consists of three main stages:

  1. Tokenization β€” the calculator parses a math expression into tokens (numbers, operators, brackets, etc.).
  2. Math expession parse - Analyzes and transform a sequence of tokens.
  3. Conversion to Reverse Polish Notation (RPN) β€” using the Shunting Yard algorithm.
  4. Evaluation β€” the calculator evaluates the expression in RPN form.

βœ… Features:

  • Supports basic operators: +, -, *, /
  • Handles parentheses
  • Parses floating-point numbers

✍️ Example:

let expression = "(12.5 + 3) * 2";
let result = calculator::evaluate(expression).unwrap();
println!("Result: {}", result); // Output: 31.0

About

Rust education

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages