npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sridhar-math-module

v1.0.3

Published

it is wrapper of math functions in Javascript

Downloads

1

Readme

sridhar-math-module - Some of the Math Operations in Javascript

sridhar-math-module - In this Module Provide some of the Math Operation's. We can do Some type of Math operations with the help of this module

Prerequisites

On Ubuntu/Debian:

sudo apt install npm nodejs

On Windows: npm install -g npm

Installation

Use Node to install from NPM Package Module

$ npm install <module name> --save

Usage of sridhar-math-module

Importing module with the help of creating node object

var sridhar-math-module = require('sridhar-math-module');

Addititon of two values

Usage
var addtiton = sridhar-math-module.add(value1,value2);
console.log(addtiton);
Example
var subtraction = sridhar-math-module.add(10,10);
console.log(addtiton);  
Output

20

Subtraction of two values

Usage
var subtraction = sridhar-math-module.sub(value1,value2);
console.log(subtraction);
Example
var subtraction = sridhar-math-module.sub(100,10);
console.log(subtraction);
Output

90

Multiplication of two values

Usage
var multiplication = sridhar-math-module.mul(value1,value2);
console.log(multiplication);
Example
var multiplication = sridhar-math-module.mul(10,10);
console.log(multiplication); 
Output

100

Division of two values

Usage
var division = sridhar-math-module.div(value1,value2);
console.log(division);
Example
var division = sridhar-math-module.div(100,10);
console.log(division);   
Output

10

Factorial of the given Number

Usage
var factorial = sridhar-math-module.fact(value);
console.log(factorial);
Example
var factorial = sridhar-math-module.fact(5);
console.log(factorial);  
Output

120

Power of the given Number

Usage
var pow = sridhar-math-module.pow(value1,values2);
console.log(pow);
Example
var pow = sridhar-math-module.pow(2,3);
console.log(pow);  
Output

8

Find the given string's are equal or not

Usage
var equals = sridhar-math-module.equals(value1,values2);
console.log(equals);
Example
var equals = sridhar-math-module.equals('Hello world','Hello world');
console.log(equals); 
Output

true

Find the greater value

Usage
var greater = sridhar-math-module.grt(value1,value2);
console.log(greater);
Example
var greater = sridhar-math-module.grt(100,102);
console.log(greater);
Output

102

Find the Lesser value

Usage
var lesser = sridhar-math-module.lser(value1,value2);
console.log(lesser);
Example
var lesser = sridhar-math-module.lser(100,120);
console.log(lesser);
Output

100

Find the Greater than or Equals value of the given values

Usage
var grt_equal = sridhar-math-module.grt_equl(value1,value2);
console.log(grt_equal);
Example
var grt_equal = sridhar-math-module.grt_equl(100,102);
console.log(grt_equal);
Output

true

Find the Greater than or Equals value of the given values

Usage
var lessequal = sridhar-math-module.lessequl(value1,value2);
console.log(lessequl);
Example
var lessequl = sridhar-math-module.lessequl(100,102);
console.log(lessequl);
Output

true

Find the Assending order of the given array

Usage
var sort = sridhar-math-module.sort(array);
console.log(sort);
Example
var sort = sridhar-math-module.sort([9,6,7,5,3,1,3,2,4]);
console.log(sort);
Output

1,2,3,4,5,6,7,8,9

Find the Reverse order of the given array

Usage
var rev_sort = sridhar-math-module.sort_reverse(array);
console.log(rev_sort);
Example
var rev_sort = sridhar-math-module.sort_reverse([9,6,7,5,3,1,3,2,4]);
console.log(rev_sort);
Output

9,8,7,6,5,4,3,2,1

Find the Reverse order of the given each Word

Usage
var reverse_each_word = sridhar-math-module.reverse_each_word(string, separator);
console.log(reverse_each_word);
Example
<!-- var reverse_each_word = sridhar-math-module.reverse_each_word("sridhar", "separator); TODO:Find the Seperate meaning -->
console.log(reverse_each_word);

Find the Given value is Integer or Not

Usage
var isInt = sridhar-math-module.isInt(Number);
console.log(isInt);
Example
var isInt = sridhar-math-module.isInt(10);
console.log(isInt);
Output

true

Create Copy of the Given Array

Usage
var duplicate_arr = sridhar-math-module.duplicate_arr(array);
console.log(duplicate_arr);
Example
var duplicate_arr = sridhar-math-module.duplicate_arr([1,2,3,4,5,6,7,7]);
console.log(duplicate_arr);
Output

[1,2,3,4,5,6,7],[1,2,3,4,5,6,7] TODO: check the Given output

Create Copy of the Given Array

Usage
var duplicate_arr = sridhar-math-module.duplicate_arr(array);
console.log(duplicate_arr);
Example
var duplicate_arr = sridhar-math-module.duplicate_arr([1,2,3,4,5,6,7,7]);
console.log(duplicate_arr);
Output

[1,2,3,4,5,6,7]

Find the Given String is Anagram or Not Anagram string

Usage
var anagrams = sridhar-math-module.anagrams(string1,stirng2); TODO: Check the input values Input1 and Input2
console.log(anagrams);
Example
var anagrams = sridhar-math-module.anagrams("example","example");
console.log(anagrams);
Output

[1,2,3,4,5,6,7] TODO: Check the output of the Given string's

Find the Sum of the Given Array

Usage
var Sum_array = sridhar-math-module.Sum_array(Array);
console.log(Sum_array);
Example
var Sum_array = sridhar-math-module.Sum_array([1,2,3,4,5]);
console.log(Sum_array);
Output

15

Find if the divisor is Divided by Divisor

Usage
var divisible_by_value = sridhar-math-module.divisible_by_value(Dividend,Divisor);
console.log(divisible_by_value);
Example
var divisible_by_value = sridhar-math-module.divisible_by_value(10,3);
console.log(divisible_by_value);
Output

false

Find the GCD of the Two values

Usage
var gcd_two_numbers = sridhar-math-module.gcd_two_numbers(x,y);
console.log(gcd_two_numbers);
Example
var gcd_two_numbers = sridhar-math-module.gcd_two_numbers(10,10);
console.log(gcd_two_numbers);
Output

false TODO: check the GCD of the two values

Find the Absolute value

Usage
var abs = sridhar-math-module.abs(x);
console.log(abs);
Example
var abs = sridhar-math-module.abs(-10);
console.log(abs);
Output

10 TODO: check the Absolute value of the output

Find the Duplicate values are present in the Given Array

Usage
var findDuplicates = sridhar-math-module.findDuplicates(x);
console.log(findDuplicates);
Example
var findDuplicates = sridhar-math-module.findDuplicates([1,2,1,2,3,4,5,3,2,3]);
console.log(findDuplicates);
Output

1,2,3

Find the Given value the Number is Positive or Negative or Zero

Usage
var get_positive_or_negative = sridhar-math-module.get_positive_or_negative(x);
console.log(get_positive_or_negative);
Example
var get_positive_or_negative = sridhar-math-module.get_positive_or_negative(-1);
console.log(get_positive_or_negative);
Output

-1 is negative number

Find the Greater Element is Present in the Array

Usage
var greater_element_arr = sridhar-math-module.greater_element_arr(array);
console.log(greater_element_arr);
Example
var greater_element_arr = sridhar-math-module.greater_element_arr([1,2,3,56,72,01,23,3435]);
console.log(greater_element_arr);
Output

3435

Find the Greater Element is Present in the Array

Usage
var lower_element_arr = sridhar-math-module.lower_element_arr(array);
console.log(lower_element_arr);
Example
var lower_element_arr = sridhar-math-module.lower_element_arr([1,2,3,56,72,01,23,3435]);
console.log(lower_element_arr);
Output

1

Find the Revese order of the Given Array

Usage
var array_reverse = sridhar-math-module.array_reverse(array);
console.log(array_reverse);
Example
var array_reverse = sridhar-math-module.array_reverse([1,2,3,4,5,6]);
console.log(array_reverse);
Output

6,5,4,3,2,1

Remove the Element by Given the Index and Returns the Given or Specified size of the Array

Usage
var remove_by_length = sridhar-math-module.remove_by_length(array,len);
console.log(remove_by_length);
Example
var remove_by_length = sridhar-math-module.remove_by_length([1,2,3,4,5,6],3);
console.log(remove_by_length);
Output

1,2,3

Remove the End of the Element in the Given Array

Usage
var remove_beginning_element_array = sridhar-math-module.remove_last_element_array(array);
console.log(remove_last_element_array);
Example
var remove_last_element_array = sridhar-math-module.remove_last_element_array([1,2,3,4,5,6]);
console.log(remove_last_element_array);
Output

1,2,3,4,5

Remove the End of the Element in the Given Array

Usage
var remove_beginning_element_array = sridhar-math-module.remove_beginning_element_array(array);
console.log(remove_beginning_element_array);
Example
var remove_beginning_element_array = sridhar-math-module.remove_beginning_element_array([1,2,3,4,5,6]);
console.log(remove_beginning_element_array);
Output

2,3,4,5,6

Remove the Specific index of the Element in the Given Array

Usage
var remove_specific_index__element_array = sridhar-math-module.remove_specific_index__element_array(array,index);
console.log(remove_specific_index__element_array);
Example
var remove_specific_index__element_array = sridhar-math-module.remove_specific_index__element_array([1,2,3,4,5,6],6);
console.log(remove_specific_index__element_array);
Output

2,3,4,5

Find the Given elememt is Perfect Number or Not

Usage
var perfect_number = sridhar-math-module.perfect_number(number);
console.log(perfect_number);
Example
var perfect_number = sridhar-math-module.perfect_number(TODO: Check the Input Element);
console.log(perfect_number);
Output

2,3,4,5, TODO:

Find the Reverse of the Given String

Usage
var reverseString = sridhar-math-module.reverseString(string);
console.log(reverseString);
Example
var reverseString = sridhar-math-module.reverseString("Hello World");
console.log(reverseString);
Output

dlroW olleH

Find the Sorting order of the Given Array

Usage
var sort_array_element = sridhar-math-module.sort_array_element(array);
console.log(sort_array_element);
Example
var sort_array_element = sridhar-math-module.sort_array_element([1,6,7,3,98,454]);
console.log(sort_array_element);
Output

1,3,6,7,98,454