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

mathlib-n

v4.0.31-beta

Published

a math library for node.js

Downloads

15

Readme

mathlib-n

mathlib-n is a Node.js library that provides a collection of mathematical functions and utilities for common mathematical operations. It is designed to be easy to use and lightweight, making it a valuable addition to your Node.js projects when you need mathematical computations.

version

Github : letest and unstable version

npm : 4.0.31-beta (stable version and recommended)

mathlib-n is a math library which can solve our simple and day to day lifes problem. like :

  • A number is odd, prime etc or not.
  • Memories data as an array or a number by , dememorise (getting memoriesed data) and delete unexpected memory by its user name.
  • Solve a quadratic equation ( ax2 + bx + c = 0 ) or a linear equation ( ax + by = c , a2x + b2y = c2)
  • Mesurementing area, length, angle etc. of any shape by their Vertex point only.
  • 23 esential constants

like those features, it has more than 100 features and constants (including built-in Math object).

Installation

You can install mathlib-n using npm or yarn:

npm install mathlib-n

or

yarn add mathlib-n

or

bower install mathlib-n

Usage

Once you have mathlib-n installed, you can use it in your Node.js project as follows:

// Import the mathlib-n module
const mathlib = require("mathlib-n");

// Example usage of mathlib-n functions
const sum = mathlib.add(5, 3); // Returns 8
const product = mathlib.mul(4, 2); // Returns 8
const difference = mathlib.sub(5, 3); // Returns 2
const quotient = mathlib.div(4, 2); // Returns 2

// You can use other functions from mathlib-n as well

Available Functions Here are some of the functions provided by mathlib-n:

  • fact(n): Calculates the factorial of a number.
  • linearEq(a, b, x): Solves a linear equation ax + b = 0 for x.
  • age(birthYear,birthMonth,birthdate,[arry of date(defult is current date)]): Calculates the age based on the birth year.
  • qudrt(a, b, c): Solves a quadratic equation ax^2 + bx + c = 0 for x.
  • avg(numbers): Calculates the average of an array of numbers.
  • logx(base, value): Calculates the logarithm of a value with a specified base.
  • rootx(base, value): Calculates the root of a value with a specified base.
  • fract(numerator, denominator): Returns the fractional representation of a number.
  • mathlib: A utility object containing mathematical constants and helper functions.
  • Vector: A class for working with vectors.
  • Matrix: A class for working with matrices.
  • length: returns the length of Mathlib object.
  • info: Displays information about the library.
  • add(a, b[,more]): Adds two or more numbers.
  • mul(a, b[,more]): Multiplies two or more numbers.
  • sub(a, b[,more]): Subtracts two or more numbers.
  • div(a, b[,more]): Divides two or more numbers etc.

Likely it has more than 130 functions and constants. You can find more details about these functions and their usage in the API documentation.

API Documentation

For a comprehensive list of available functions and their detailed usage information here

Examples

We have provided a collection of usage examples in the test folder. You can run these examples using the following command:

npm run examples --prefix node_modules/mathlib-n

License

mathlib-n is licensed under the MIT License. See the LICENSE file for details.

Support and Contact

For questions, bug reports, feature requests, or general assistance, you can contact me at [email protected] or place an issue on GitHub repository.

Troubleshooting

fix memory

Be sure that, you don't use any synchronise loop like for or while loop with asynchronous memo(). if you use that, the memory will ruined. Then you should do this work :

npm run fix-memo --prefix node_modules/mathlib-n

there will be an animation of MathLib ,but you can skip it by pressing ctrl + c for windows and cmd + c for mac. But if you continue with the animation you can know the current mode and status and you can also know about your records and trushes.

change or intalige mode

Two mode are available now on mathlib-n. They are science and fix mode. sci for science and fix for fix mode. and status is the count of how many number will be after decimal.

npm run modechanger --prefix node_modules/mathlib-n

or you can chance mode via code

const mathlib = require("mathlib-n");
mathlib.getmode(); // to know the current mode
mathlib.setmode("fix", 2); // 2 is the status

There will be an animation of MathLib ,but you can skip it by pressing ctrl + c for windows and cmd + c for mac. But if you continue with the animation you can know the current mode and status and you can also know about your records and trushes.

History

Keywords

  • math
  • mathlib-n
  • mathLib
  • math library
  • mathlib
  • mathlibjs
  • mathjs

documentation

Documentation

A little description :

  • math.length : It will give you the length of math object.
  • math.mathlib() : It's a fun function. There is no such important work it done. It's just a terminal animation. But it will give you some important information about your calculation mode and your saved,restored and trushed files number at the end.
  • math.recList : return an array of record's files name.

Licence

MIT

History

Current version : 4.0.31-beta

History