plus_minus_multiply_divide
v1.0.3
Published
My Package for basic arithmetic operations
Downloads
5
Maintainers
Readme
README.md
Calculator Module
This module provides basic arithmetic operations such as addition, subtraction, multiplication, and division.
Import in your project by command
const calculator = require('plus_minus_multiply_divide');
Functions:
- add(a, b): Adds two numbers
a
andb
and returns the result. - subtract(a, b): Subtracts
b
froma
and returns the result. - multiply(a, b): Multiplies
a
byb
and returns the result. - divide(a, b): Divides
a
byb
and returns the result.
Usage:
const calculator = require('plus_minus_multiply_divide');
console.log(calculator.add(5, 3)); // Output: 8
console.log(calculator.subtract(10, 4)); // Output: 6
console.log(calculator.multiply(2, 6)); // Output: 12
console.log(calculator.divide(10, 2)); // Output: 5