Skip to content

Latest commit

 

History

History
78 lines (61 loc) · 2.13 KB

README.md

File metadata and controls

78 lines (61 loc) · 2.13 KB

Scientific Calculator

rust License: GPL v3

Caution

This calculator is currently under active development. While it offers a broad range of scientific functionalities, please be aware that certain calculations might not work as expected.

I strongly advise against using this tool for any critical or sensitive computations.

A scientific calculator built with Rust and egui framework, offering a modern graphical interface for mathematical calculations.

Features (and whether they work)

  • Basic arithmetic operations with two arguments (+, -, *, /)
  • Scientific functions (sin, cos, tan, log)
  • Trigonometric functions in both RAD/DEG modes
  • Constants (π, e)
  • Error handling and input validation
  • Clean and intuitive GUI

Technologies

  • Rust programming language
  • eframe/egui for GUI
  • num crate for numerical computations
  • libm for mathematical functions

Installation

  1. Ensure you have Rust installed. If not, install from rustup.rs
  2. Clone the repository:
git clone https://github.com/yourusername/scientific_calculator.git
cd scientific_calculator
  1. Build the project:
cargo build --release

Usage

Run the calculator:

cargo run --release

Basic Operations

  • Use number buttons (0-9) for input
  • Click operators (+, -, *, /) for calculations
  • Press '=' to evaluate
  • 'C' clears the display
  • '±' changes number sign

Scientific Functions

  • Trigonometric: sin, cos, tan, asin, acos, atan
  • Logarithmic: ln, log
  • Constants: π (pi), e (euler's number)
  • Switch between RAD/DEG modes for trigonometry

Testing

Run the test suite:

cargo test

Tests cover:

  • Calculator initialization
  • Basic arithmetic operations
  • Expression formatting
  • Error handling

Preview

image