GithubHelp home page GithubHelp logo

vimal-verma / prime-num Goto Github PK

View Code? Open in Web Editor NEW
8.0 5.0 11.0 4 KB

prime-num is an math library for JavaScript and Node.js. It help you to find all prime number.

Home Page: https://www.npmjs.com/package/prime-num

License: MIT License

JavaScript 100.00%
npm npm-package npm-module open-source opensource prime-num letskhabar hacktoberfest prime-upto javascript math-library

prime-num's Introduction

prime-num is an math library for JavaScript and Node.js. It help you to find all prime number.

Version license download download Fork Star watch

Features

  • find all prime number upto n. [ primes(n) ]

  • find all prime number between m to n. [ primebtw(m,n) ]

  • find number of prime upto n. [ primelength(n) ]

  • find number of prime between m to n. [ primebl(m,n) ]

  • find a number n is Prime or not. [ isPrime(n) ]

  • Can be used in command line as well.

  • Runs on any JavaScript engine.

  • Is easily extensible.

  • Open source.

Usage

prime-num can be used in both node.js and in the browser.

Install prime-num using npm:

npm install prime-num
const {primes,primelength,isPrime,primebtw,primebl} = require('prime-num');

console.log(primes(25));       // 2,3,5,7,11,13,17,19,23
console.log(primelength(25));  // 9
console.log(isPrime(25));      // false
console.log(primes(53));       // 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53
console.log(primelength(53));  // 16
console.log(isPrime(53));      // true
console.log(primebtw(53,10));  // 11,13,17,19,23,29,31,37,41,43,47,53
console.log(primebl(53,10));   // 12

Run

node index.js

See the Getting Started for a more detailed tutorial.

Documentation

Clone the project from github:

git clone https://github.com/letskhabar/prime-num.git
cd prime-num

License

MIT, Copyright (C) 2020

prime-num's People

Contributors

vimal-verma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.