Skip to content

denboba/JsCalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic Calculator

This is a simple calculator web application built using HTML, CSS, and JavaScript. The calculator provides basic arithmetic operations such as addition, subtraction, multiplication, division, and exponentiation.

Features

  • Basic arithmetic operations: addition, subtraction, multiplication, and division
  • Exponentiation
  • Handling parentheses
  • Clear functionality
  • Responsive design

Usage

  1. Open the index.html file in any modern browser.
  2. To perform calculations, click on the buttons provided on the calculator interface. The calculator supports:
    • Basic arithmetic operations by using the + , - , * , and / buttons
    • Exponentiation by using the ^ button
    • Parentheses by using the ( and ) buttons
    • Decimal numbers by using the . button
  3. Click the C button to clear the display.
  4. Click the = button to calculate the result.

Dependencies

The calculator uses the Math.js library (version 9.0.0) to evaluate mathematical expressions: https://cdnjs.cloudflare.com/ajax/libs/mathjs/9.0.0/math.min.js

Notes:

  • The calculator uses the ** operator internally for exponentiation while displaying ^ on the display for user readability.
  • The calculator does not support keyboard input at the moment. Only button clicks are allowed for input.

Future Improvements

  • Add keyboard input support for a better user experience.
  • Add support for more advanced mathematical functions, such as trigonometric and logarithmic functions.
  • Improve error handling for invalid expressions.
  • Add memory functions (MC, MR, M+, M-) for more advanced calculations.

About

Basic calculator using Javascipt, HTML and CSS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages