/calculator-react

A simple web-based calculator built with React.js and the Math.js library, capable of performing basic arithmetic operations while following the order of operations (BODMAS).

Primary LanguageJavaScript

React Calculator with Math.js

Explore the Calculator Tool Here.

A simple web-based calculator built with React.js and the Math.js library, capable of performing basic arithmetic operations while following the order of operations (BODMAS).

Features

  • Perform addition, subtraction, multiplication, and division.
  • Handles decimal numbers and follows the BODMAS (Brackets, Orders, Division, Multiplication, Addition, Subtraction) rule for correct evaluation.
  • Clear the (C) button to reset the input.
  • Delete (Del) button to remove the last character.
  • Supports negative numbers.
  • Returns an error message for invalid expressions.
  • User-friendly interface for easy calculation.

Technologies Used

Installation

  1. Clone this repository to your local machine.
  2. Navigate to the project directory.
  3. Install dependencies using npm install.
  4. Run the application with npm start.
  5. Open your browser and access the application at http://localhost:3000.

Usage

  • Enter mathematical expressions in the calculator input field.
  • Click the "=" button to calculate the result.
  • Use "C" to clear the input and start over.
  • "Del" can be used to delete the last character in the input.

Author

Harsha Vardhan Konisa

Acknowledgments

This project was created as a learning exercise in building web applications with React.js and using the Math.js library for mathematical evaluations.