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

super-mathjs

v1.0.8

Published

A library that brings recycled or new more understandable functions, understandable variables and much more!

Downloads

2

Readme

super-mathjs

A library to simply math

Installation:

yarn add super-mathjs :: npm i super-mathjs ...

Usage examples

Table

const { Table } = require('super-mathjs')   
// If you want add:

new Table(numbers[]).add()
    // Example:
    new Table(15, 123, 43).add() // ==> 181

// If you want divide:

new Table(a:number, b:number).divide()
    // Example:
    new Table(83, 3).divide() // ==> 27.666666666666668

// If you want subtract:

new Table(a:number, b:number).subtract()
    // Example:
    new Table(83, 3).subtract() // ==> -5431

// If you want multiply:
new Table(numbers[]).multiply()
    // Example:
    new Table(2, 623, 91, 3).multiply() // ==> 340158

Functions

const app = require('super-mathjs')
// This will serve to find the radius of a circle
app.circleradio(radio:number)
    // Example:
    app.circleradio(12) // ==> 452.3893421169302
const app = require('super-mathjs')
// This function is used to compare two numbers, if they are equal they will return true, otherwise they will return false.
app.compare(a:number, b:number)
    // Example:
    app.compare(12, 12) // ==> true
    app.compare(213, 212+1) // ==> true
    app.compare(213, 132) // ==> false
    app.compare(211+2, 212+1) // ==> true
const app = require('super-mathjs')
// This function is used to raise a number (base) with another number (exponent)
app.elevate(base:number, exponent:number)
    // Example:
    app.elevate(5, 2) // ==> 25
    app.elevate(523, 223) // ==> Infinity
    app.elevate(-523, 223) // ==> -Infinity
    app.elevate(-2, +4) // ==> 16
const app = require('super-mathjs')
// With this function you can get the highest number.
app.max(numbers[])
    // Example:
    app.max(5, 2, 10, 14, 65, 13012, 1, 0) // ==> 13012
    app.max(0, 0, 0, 0) // ==> 0
    app.max(-16, -15, -14, -13) // ==> -13
const app = require('super-mathjs')
// With this function you can get the lowest number.
app.min(numbers[])
    // Example:
    app.min(5, 2, 10, 14, 65, 13012, 1, 0) // ==> 0
    app.min(0, 0, 0, 0) // ==> 0
    app.min(-16, -15, -14, -13) // ==> -16
const app = require('super-mathjs')
// With this function you can get the percentage of a number.
app.percentage(a: number, b: number)
    // Example:
    app.percentage(100, 30) // ==> 30
    app.percentage(30, 100) // ==> 30
const app = require('super-mathjs')
// With this function you can get a random number with two bases, a minimum and a maximum.
app.random(a: number, b: number)
    // Example:
    app.random(1, 2) // ==> 2/1
    app.random(2, 1) // ==> 2/1
const app = require('super-mathjs')
// With this function you will be able to evaluate numbers more professionally.
app.review(numbers[])
    // Example:
    app.review('12.7 cm to inch') // ==> 5 inch
    app.review('sin(45 deg) ^ 2') // ==> 0.5
const app = require('super-mathjs')
// With this function you will be able to know the square root of a number.
app.root2(a:number)
    // Example:
    app.root2(64) // ==> 8
    app.root2(-64) // ==> NaN
const app = require('super-mathjs')
// With this function you will be able to know the cube root of a number.
app.root3(a:number)
    // Example:
    app.root3(64) // ==> 4
    app.root3(-64) // ==> -4
const app = require('super-mathjs')
// With this function you can round a number to the nearest next.
app.round(value:number)
    // Example:
    app.round(123.99) // ==> 124
const app = require('super-mathjs')
// With this function you can verify if a value is a number or not, if it is it will return true, if it is not it will return false
app.verify(value:number));     
    // Example:
    app.verify(-1.1);                // ==> true
    app.verify('2a1');              // ==> true
    app.verify('-1.1');              // ==> true
    app.verify(parseInt('08'));      // ==> true
    app.verify(parseFloat('08'));    // ==> true
    app.verify([0, 1, 2]);           // ==> true
    app.verify(null);                // ==> false
    app.verify('');                  // ==> false
    app.verify('hi');                // ==> false
    app.verify(['ax', 'bn', 'cd']);  // ==> false
    app.verify(function () {});      // ==> false
const app = require('super-mathjs')
// With this function you can return only the integer part of a given number.
app.whole(a: number)
    // Example:
    app.whole(123.99999999999) // ==> 123
    app.whole(-1.5) // ==> -1
const app = require('super-mathjs')
// With this function you can round a given number up to the previous whole number.
app.wholea(a: number)
    // Example:
    app.wholea(123.99999999999) // ==> 123
    app.wholea(-1.3) // ==> -2
const app = require('super-mathjs')
// With this function you can round a given number up to the next whole number.
app.wholes(a: number)
    // Example:
    app.wholes(0.1) // ==> 1
    app.wholes(-1.5) // ==> -1
    app.wholes(-0.9) // ==> -0

Variables

const app = require('super-mathjs')
app.root2x // ==> 1.4142135623730951 - √2.
app.euler // ==> 2.718281828459045 - The Euler rule.
app.pi // ==> 3.141592653589793 - It is the ratio of the length of the circumference of a circle to its diameter.
app.pinf // ==> Infinity - Represents positive infinity.
app.ninf // ==> -Infinity - Represents negative infinity.
app.maxnum // ==> 1.7976931348623157e+308 - Returns as many JavaScript as possible.
app.minnum // ==> 5e-324 - Returns the smallest possible number in JavaScript.

Changelog

v1.0.0

  • Release.

v1.0.1

  • poo function.