#host Link https://astounding-sherbet-af3d50.netlify.app/
This is a simple calculator built using React. It performs basic arithmetic calculations and supports additional operations like square root, exponentiation, and logarithm.
- Addition, subtraction, multiplication, and division operations
- Exponentiation: x^2, x^3
- Square root: √x
- Logarithm: log(x)
- Ability to input and display expressions
- Clear input and answer
- Backspace functionality
- Change sign of the expression
To run the calculator on your local machine, follow these steps:
- Clone the repository:
git clone https://github.com/apni-coding/Calculator-Using-React
- Navigate to the project directory:
cd calculator
- Install the dependencies:
npm install
- Start the development server:
npm start
- Open your browser and visit
http://localhost:3000
to see the calculator in action.
- Enter the mathematical expression using the calculator buttons or by typing directly into the input field.
- Click the "=" button or press Enter to calculate the result.
- The calculated result will be displayed in the answer field.
- To clear the input and answer, click the "C" button.
- To remove the last character from the input, click the backspace button.
- To change the sign of the expression (positive/negative), click the "+/-" button.
- The calculator has a maximum input length of 14 characters.
- React: A JavaScript library for building user interfaces
- mathjs: A comprehensive math library for JavaScript
Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.
This project is licensed under the MIT License.
- This calculator was inspired by various online calculators and tutorials.