simple-calcy
v1.0.1
Published
A simple Calculator
Downloads
4
Readme
Simple Calculator
Simple Calculator is a lightweight JavaScript library that provides basic arithmetic operations.
Installation
You can install Simple Calculator via npm:
npm i simple-calcy
Usage
// Import the SimpleCalculator class
"const SimpleCalculator = require('simple-calculator');"
// Create a new instance of SimpleCalculator
"const calculator = new SimpleCalculator();"
// Perform arithmetic operations
"console.log(calculator.add(5, 3));" // Output: 8
"console.log(calculator.subtract(5, 3));" // Output: 2
"console.log(calculator.multiply(5, 3));" // Output: 15
"console.log(calculator.divide(6, 3));" // Output: 2
API
Add
"add(x, y)"
Adds two numbers x and y and returns the result.
Subtract
"subtract(x, y)"
Subtracts the second number y from the first number x and returns the result.
Multiply
"multiply(x, y)"
Multiplies two numbers x and y and returns the result.
Divide
"divide(x, y)"
Divides the first number x by the second number y and returns the result.
License
This project is licensed under the MIT License - see the LICENSE file for details.
This README includes a brief description of the package, installation instructions, basic usage example, and the license information.