Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 2.75 KB

README.md

File metadata and controls

73 lines (52 loc) · 2.75 KB

Scientific Calculator

I developed this scientific calculator using HTML, CSS, and JavaScript. This calculator supports a wide range of mathematical functions, from basic arithmetic operations (addition, subtraction, multiplication, division) to advanced features such as trigonometry, logarithms, exponentiation, permutations, combinations, and more. It's not limited to solving basic expressions; it efficiently handles complex and nested expressions as I utilized the concept of regular expressions in JavaScript. Additionally, I incorporated features like calculation history and customizable default settings, etc., using the concept of local storage.

Quick Demo

screenRecording.mp4

Technologies Used

  1. HTML
  2. CSS
  3. JavaScript

In this project, I used HTML to structure the content, CSS to ensure styling and responsiveness, and JavaScript for dynamic interactions and to solve mathematical expressions. To achieve the mathematical computations, I used various built-in functions in JavaScript, such as eval() and the functions like Math.log(), Math.PI, Math.sin(), and others. Additionally, I implemented the concept of regular expressions in JavaScript to efficiently handle complex and nested expressions.

Features

Advance features

  • Calculation History: Implemented using local storage to keep track of previous calculations.
  • Settings Button: Added buttons to adjust default settings for enhanced user customization.

Basic Operations

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • and more...

Trigonometric Functions (supports both degrees and radians)

  • Sine
  • Cosine
  • Tangent

Inverse Trigonometric Functions

  • Arcsine
  • Arccosine
  • Arctangent

Logarithmic Functions

  • Logarithm (with any base)
  • Natural logarithm (base e)

Exponential Functions

  • Exponential power
  • e^x
  • 10^x

Other Functions

  • Square Root
  • Permutation and Combination calculations
  • Factorial computation and many more.

Known Issues

Although I have tried my best to replicate the features of the mobile inbuilt calculator, it cannot handle all complex expressions perfectly. However, these complex mathematical expressions can be easily handled using regular expressions in JavaScript, but due to limited time, I did not do so.

Getting Started

Follow the steps below to install and run the project on your local machine.

1. Clone this repository:

git clone https://github.com/Ankit-Matth/scientific-calculator.git

2. Access the project directory:

cd scientific-calculator

3. Open the index.html file in your web browser and see the magic.