a simple desktop calculator application built with rust and egui.
made it just to get more familiar with rust. directions below i had cursor write out for me, so i'll edit later.
Make sure you have Rust installed on your system. If not, install it from rustup.rs.
cargo runcargo build --releaseThe executable will be located at target/release/calculator.exe (Windows) or target/release/calculator (Linux/Mac).
The calculator opens as a desktop window with:
- Number buttons: 0-9 for entering numbers
- Operation buttons: +, -, *, / for mathematical operations
- Clear button (C): Clears the current calculation
- Equals button (=): Performs the calculation
- Decimal point (.): For decimal numbers
- Basic arithmetic operations (addition, subtraction, multiplication, division)
- Decimal number support
- Division by zero error handling
- Clean, modern GUI interface
- Click number buttons to enter the first number (e.g.,
5) - Click an operator button (e.g.,
+) - Click number buttons to enter the second number (e.g.,
3) - Click
=to see the result (8) - Click
Cto clear and start a new calculation
calcuhater/
├── Cargo.toml # Project configuration with egui dependencies
├── README.md # This file
└── src/
└── main.rs # Main calculator GUI code
- Rust: Systems programming language
- egui: Immediate mode GUI framework
- eframe: Native framework for egui applications