@hsc92180/calc_simple
v1.0.2
Published
A simple calculator library
Downloads
2
Readme
@hsc92180/calc_simple
Description
A simple calculator library for performing basic arithmetic operations such as addition, subtraction, multiplication, and division.
Installation
You can install this library via npm:
npm install @hsc92180/calc_simple
Usage
const calculator = require('@hsc92180/calc_simple');
// Add two numbers
const sum = calculator.add(5, 3); // Output: 8
// Subtract two numbers
const difference = calculator.subtract(10, 4); // Output: 6
// Multiply two numbers
const product = calculator.multiply(6, 7); // Output: 42
// Divide two numbers
const quotient = calculator.divide(20, 4); // Output: 5
API
add(a, b)
Adds two numbers a
and b
and returns the result.
subtract(a, b)
Subtracts b
from a
and returns the result.
multiply(a, b)
Multiplies two numbers a
and b
and returns the result.
divide(a, b)
Divides a
by b
and returns the result.
License
This library is licensed under the ISC License.
Author
Created by Himanshu.