1.0.7 • Published 2 years ago

calclibmodule v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Calculator Library Module

This module contains eight simple functionalities of addition, subtraction, multiplication, division, power, square, cube, modulus as respective functions with the following names:

Addition(a,b) - Takes as parameters two variables a and b containing numbers and returns their sum as a+b.

Subtraction(a,b) - Takes as parameters two variables a and b containing numbers and returns their difference as a-b.

Multiplication(a,b) - Takes as parameters two variables a and b containing numbers and returns their product as a*b.

Division(a,b) - Takes as parameters two variables a and b containing numbers and returns quotient as a/b.

Power(a,b) - Takes as parameters two variables a and b containing numbers and returns first number raised to power of second number as a**b.

Square(num) - Takes as parameter a variable num containing number and returns its square as num*num.

Cube(num) - Takes as parameter a variable num containing number and returns its cube as num*num*num.

Modulus(a,b) - Takes as parameters two variables a and b containing numbers and returns first number modulo second number as a%b.

Install via Node Package Manager(NPM)

To install the module on your system, open your cmd/terminal and punch in
npm i calclibmodule
OR
npm install calclibmodule

Usage Example

To use this module, open your favourite code editor, say, Visual Studio Code and Create a directory with
mkdir directoryName

Move inside this directory with
cd directoryName

To generate a package.json file that will automatically keep records of all the dependencies installed, type in the terminal
npm init

To download packagemoduleforaddition, type in the terminal
npm install calclibmodule
OR
npm i calclibmodule

Now create a file named say app.js by typing
touch app.js

Open this file from the explorer in VSCode, and punch in
const ob = require("calclibmodule")
console.log(ob.Addition(2, 4))
console.log(ob.Subtraction(25, 5))
console.log(ob.Multiplication(5, 5))
console.log(ob.Division(6, 2))
console.log(ob.Power(4, 5))
console.log(ob.Square(4))
console.log(ob.Cube(3))
console.log(ob.Modulus(5, 4))

Run this code in the terminal by writing
node app.js

Voila! Your output in the terminal will be
6
20
25
3
1024
16
27
1

Thank you for reading :D

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago