{"id":19551400,"url":"https://github.com/dr-montasir/mnjs","last_synced_at":"2025-04-26T20:31:15.462Z","repository":{"id":57299365,"uuid":"304387337","full_name":"dr-montasir/mnjs","owner":"dr-montasir","description":"MATH NODE JS (MNJS): A tiny math library for node.js \u0026 JavaScript on browser","archived":false,"fork":false,"pushed_at":"2023-01-22T23:08:52.000Z","size":155,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-18T21:29:06.279Z","etag":null,"topics":["data-analysis","data-science","javascript","js","jsdelivr","library","math","nextjs","npm","react","svelte","sveltekit","ts","typescript","yarn"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/mnjs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dr-montasir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-15T16:34:01.000Z","updated_at":"2025-02-11T05:32:37.000Z","dependencies_parsed_at":"2023-02-12T18:45:15.499Z","dependency_job_id":null,"html_url":"https://github.com/dr-montasir/mnjs","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dr-montasir%2Fmnjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dr-montasir%2Fmnjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dr-montasir%2Fmnjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dr-montasir%2Fmnjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dr-montasir","download_url":"https://codeload.github.com/dr-montasir/mnjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251051368,"owners_count":21528787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","data-science","javascript","js","jsdelivr","library","math","nextjs","npm","react","svelte","sveltekit","ts","typescript","yarn"],"created_at":"2024-11-11T04:13:47.249Z","updated_at":"2025-04-26T20:31:12.437Z","avatar_url":"https://github.com/dr-montasir.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## mnjs\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) [![mnjs version](https://img.shields.io/npm/v/mnjs.svg?style=flat-square)](https://www.npmjs.com/package/mnjs) [![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/mnjs.svg)]() [![npm](https://img.shields.io/npm/dt/mnjs.svg)]() [![npm](https://img.shields.io/npm/dm/mnjs.svg)]() [![](https://data.jsdelivr.com/v1/package/npm/mnjs/badge)](https://www.jsdelivr.com/package/npm/mnjs)\n\n\u003e MATH NODE JS (MNJS): A tiny math library for node.js \u0026 JavaScript on browser\n\n## Installation\n\n`npm install mnjs`\n\n[![http://placehold.jp/24/cb0101/ffffff/280x45.png?text=npm%20install%20mnjs](http://placehold.jp/24/cb0101/ffffff/280x45.png?text=npm%20install%20mnjs)](https://www.npmjs.com/package/mnjs)\n\n`yarn add mnjs`\n\n[![http://placehold.jp/24/25799f/ffffff/280x45.png?text=yarn%20add%20mnjs](http://placehold.jp/24/25799f/ffffff/280x45.png?text=yarn%20add%20mnjs)](https://classic.yarnpkg.com/en/package/mnjs)\n\n`\u003cscript src=\"https://cdn.jsdelivr.net/npm/mnjs/index.js\"\u003e\u003c/script\u003e`\n\n[![http://placehold.jp/24/bd483b/fec82f/785x45.png?text=%3Cscript%20src%3D%22https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2Fmnjs%22%3E%3C%2Fscript%3E](http://placehold.jp/24/bd483b/fec82f/785x45.png?text=%3Cscript%20src%3D%22https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2Fmnjs%2Findex.js%22%3E%3C%2Fscript%3E)](https://www.jsdelivr.com/package/npm/mnjs)\n\n## Some of the solutions provided by the mnjs library\n\n```js\n// JavaScript\n0.1 + 0.2 = 0.30000000000000004   // 0.1 + 0.2 === 0.3 returns false\n0.2 + 0.7 = 0.8999999999999999    // 0.2 + 0.7 === 0.9 returns false\n0.7 - 0.2 = 0.49999999999999994   // 0.7 - 0.2 === 0.5 returns false\n0.1 * 0.2 = 0.020000000000000004  // 0.1 * 0.2 === 0.02 returns false\n0.3 / 0.1 = 2.9999999999999996    // 0.3 / 0.1 === 3 returns false\n1.2 % 0.5 = 0.19999999999999996   // 1.2 / 0.5 === 0.2 returns false\n\n// MNJS library\nmnjs.add(0.1, 0.2)   = 0.3      // mnjs.add(0.1, 0.2)  === 0.3 returns true\nmnjs.add(0.2, 0.7)   = 0.9      // mnjs.add(0.2, 0.7)  === 0.9 returns true\nmnjs.subt(0.7, 0.2)  = 0.5      // mnjs.subt(0.7, 0.2) === 0.5 returns true\nmnjs.mult(0.1, 0.2)  = 0.02     // mnjs.mult(0.1, 0.2) === 0.02 returns true\nmnjs.divi(0.3, 0.1)  = 3        // mnjs.divi(0.3, 0.1) === 3 returns true\nmnjs.rem(1.2, 0.5)   = 0.2      // mnjs.rem(1.2, 0.5)  === 0.2 returns true\n```\n\n```html\n\u003c!-- html --\u003e\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\t\u003chead\u003e\n\t\t\u003ctitle\u003emnjs\u003c/title\u003e\n\t\t\u003c!--\u003cscript src=\"https://cdn.jsdelivr.net/npm/mnjs@4.4.0/index.js\"\u003e\u003c/script\u003e--\u003e\n\t\t\u003cscript src=\"https://cdn.jsdelivr.net/npm/mnjs/index.min.js\"\u003e\u003c/script\u003e\n\t\t\u003c!--            This link is the latest mini version ☝             --\u003e\n\t\u003c/head\u003e\n\t\u003cbody\u003e\n\t\t\u003cscript\u003e\n\t\t\tlet myNumber = 0.1;\n\t\t\tconst myCube = mnjs.cube(myNumber);\n\t\t\t// mnjs.cube(0.1) returns 0.001\n\t\t\tconsole.log(`(${myNumber})^3 returns ${myCube} in mnjs library`);\n\t\t\t// Math.pow(0.1, 3) or (0.1 * 0.1 * 0.1) returns 0.0010000000000000002\n\t\t\tconsole.log(`(${myNumber})^3 returns ${Math.pow(myNumber, 3)} in JavaScript`);\n\t\t\u003c/script\u003e\n\t\u003c/body\u003e\n\u003c/html\u003e\n```\n\n```js\n// Next JS\n// index.js\n// npm install mnjs --save\nimport mnjs from 'mnjs';\nimport React from 'react';\n\nconst Home = () =\u003e {\n\n  const price = 4.5 / 3;\n\n  return (\n    \u003cdiv\u003e\n      \u003cul\u003e\n        \u003cli\u003e{mnjs.add([1,8], 1).[1]}\u003c/li\u003e\n        \u003cli\u003e{mnjs.fix(1, 2)}\u003c/li\u003e\n        \u003cli\u003e{mnjs.fix(mnjs.phi,2)}\u003c/li\u003e\n        \u003cli\u003e{mnjs.stn('8.00')}\u003c/li\u003e\n        \u003cli\u003e{mnjs.zeros(2,2)}\u003c/li\u003e\n        \u003cli\u003e{mnjs.zeros(2.1,2)}\u003c/li\u003e\n        \u003cli\u003e{mnjs.zeros(2.1440000000,2)}\u003c/li\u003e\n        \u003cli\u003e{mnjs.zeros(2.1440000000,5)}\u003c/li\u003e\n        \u003cli\u003e${mnjs.zeros(price,2)}\u003c/li\u003e\n        \u003cli\u003e\n            \u003ca\n              className=\"App-link\"\n              href=\"https://www.npmjs.com/package/mnjs\"\n              target=\"_blank\"\n              rel=\"noopener noreferrer\"\n            \u003e\n              Learn MNJS (Math Node JS)\n            \u003c/a\u003e\n        \u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/div\u003e\n  );\n};\n\nexport default Home;\n```\n\n```js\n// React JS\n// App.js\n// npm install mnjs --save\nimport { divi, zeros, stn, nts } from 'mnjs';\nimport logo from './logo.svg';\nimport './App.css';\n\nfunction App() {\n\tconst price = divi(4.2, 3);\n\tconst priceWithFormat = zeros(price, 2);\n\n\treturn (\n\t\t\u003cdiv className=\"App\"\u003e\n\t\t\t\u003cheader className=\"App-header\"\u003e\n\t\t\t\t\u003cimg src={logo} className=\"App-logo\" alt=\"logo\" /\u003e\n\t\t\t\t\u003cp\u003e\n\t\t\t\t\tEdit \u003ccode\u003esrc/App.js\u003c/code\u003e and save to reload.\n\t\t\t\t\u003c/p\u003e\n\t\t\t\t\u003ca className=\"App-link\" href=\"https://reactjs.org\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n\t\t\t\t\tLearn React\n\t\t\t\t\u003c/a\u003e\n\t\t\t\t\u003cbr /\u003e\n\t\t\t\t\u003ca className=\"App-link\" href=\"https://www.npmjs.com/package/mnjs\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n\t\t\t\t\tLearn MNJS (Math Node JS)\n\t\t\t\t\u003c/a\u003e\n\t\t\t\t\u003ch2\u003e\n\t\t\t\t\t\u003cp\u003e${nts(0.0)}\u003c/p\u003e\n\t\t\t\t\tFree ${zeros(stn('0.00'), 2)} \u003cstrike\u003e${priceWithFormat}\u003c/strike\u003e\n\t\t\t\t\u003c/h2\u003e\n\t\t\t\t\u003csmall\u003eType: {typeof priceWithFormat}\u003c/small\u003e\n\t\t\t\u003c/header\u003e\n\t\t\u003c/div\u003e\n\t);\n}\n\nexport default App;\n```\n\n```js\n// Node JS\n// index.js\n// npm install mnjs --save\n\n// import mnjs from 'mnjs';\n// console.log(mnjs.sin.deg(mnjs.range(0, 90, 30)));\n// Or\n\nimport { sin, range } from 'mnjs';\nconsole.log(sin.deg(range(0, 90, 30)));\n```\n\n## Examples\n\n\u003e Use `console.log()` to output the result. `console.log(mnjs.abs(-3.6)); // 3.6`\n\n```js\nconst mnjs = require(`mnjs`);\n\nmnjs.abs(-3.6); // 3.6\n\nmnjs.subt(2, 5); // -3\n\nmnjs.sqr(2) + mnjs.sqrt(4); // 6\n\nmnjs.sqr(4) + mnjs.sqrt(4) / mnjs.pi; // 16.63661977236758\n\nmnjs.e; // 2.718281828459045\n\nmnjs.exp(1); // 2.718281828459045\n\nmnjs.exp(-1); // 0.367879441171442\n\nmnjs.exp(mnjs.pi / 3); // 2.849653908226361\n\nmnjs.log(10); // 2.302585092994046\n\nmnjs.ln2; // 0.693147180559945\nmnjs.ln10; // 2.302585092994046\n\nmnjs.log2e; // 1.442695040888963\nmnjs.log10e; // 0.434294481903252\n\nmnjs.log1p(5); // 1.791759469228055\n\nmnjs.log(mnjs.e); // 1\n\nmnjs.hypot(4); // 4\nmnjs.hypot([4]); // 4\nmnjs.hypot(3, 4); // 5\nmnjs.hypot([3, 4]); // 5\nmnjs.hypot(4, 2, 4); // 6\nmnjs.hypot([4, 2, 4]); // 6\nmnjs.hypot([-3, -4]); // 5\nmnjs.hypot(-3, -4); // 5\nmnjs.hypot([-4]); // 4\nmnjs.hypot(-4); // 4\nmnjs.sqrt(mnjs.add(mnjs.sqr(6), mnjs.sqr(8))) === mnjs.hypot(6, 8); // true\nmnjs.hypot([-3, -4], 1); // Error: MNJS ERROR No. 01 : 05\nmnjs.hypot([-3, -4], [1]); // Error: MNJS ERROR No. 01 : 05\nmnjs.hypot([-3, -4, '1']); // Error: MNJS ERROR No. 01 : 05\n\nmnjs.fix(2.718281828459045, 2); // 2.72\n\nmnjs.inv(10); // 0.1\n\nmnjs.ceil(1.1); // 2\nmnjs.ceil(-1.1); // -1\nmnjs.ceil([-0.2, 0, 0.2]); // [-0, 0, 1]\n\nmnjs.max(1, 10, 3, -2); // 10\nmnjs.max([1, 10, 3, -2]); // 10\nmnjs.max(1, 10, 3, ''); // Error: MNJS ERROR No. 01 : 05\n\nmnjs.min(5, 1, -3.2, 0.5, 3); // -3.2\nmnjs.min([5, 1, -3.2, 0.5, 3]); // -3.2\nmnjs.min(); // Error: MNJS ERROR No. 01 : 05\nmnjs.min([]); // Error: MNJS ERROR No. 01 : 05: This function accepts numeric arguments or one numeric array argument. (num1, num2, ..., num) =\u003e {} or ([num1, num2, ..., num]) =\u003e {}\n\nmnjs.pow(2, 4); // 16\n\nmnjs.pow(2, -2.5); // 0.176776695296637\n\nmnjs.cbrt(8); // 2\n\nmnjs.nrt(0.0001, 4); // 0.1\nmnjs.nrt(Infinity, Infinity); // 1\nmnjs.nrt(Infinity, Infinity) === mnjs.pow(Infinity, 1 / Infinity); // true\n\nmnjs.tau; // 6.283185307179586\n\nmnjs.sin(1); // 0.841470984807897\nmnjs.sin.rad(1); // 0.841470984807897\nmnjs.sin(1) === mnjs.sin.rad(1); // true\n\nmnjs.dtr(30); // 0.523598775598299\nmnjs.sin.deg(30); // 0.5\nmnjs.sin.deg(30) === mnjs.sin(mnjs.dtr(30)); // true\n\nmnjs.cos.deg(60); // 0.5\nmnjs.cos(0); // 1\nmnjs.cos.rad(0); // 1\nmnjs.cos(1) === mnjs.cos.rad(1); // true\n\nmnjs.tan.deg(45); // 1\n\nmnjs.tan(0.5); // 0.54630248984379\nmnjs.tan(0.5) === mnjs.tan.rad(0.5); // true\n\nmnjs.tan.deg(90); // -Infinity\n\n1 / mnjs.sin.deg(30); // 2\nmnjs.csc.deg(30)(\n\t// 2\n\n\t1 / mnjs.cos.deg(60)\n) === mnjs.sec.deg(60); // true\nconsole.log(mnjs.sec.deg(60))(\n\t// 2\n\n\t1 / mnjs.tan.deg(45)\n) === mnjs.cot.deg(45); // true\nmnjs.cot.deg(45); // 1\n\nmnjs.cot.deg(0); // Infinity\n\nmnjs.acsc(mnjs.csc(0.67)); // 0.67\n\nmnjs.asec.rad(1) === mnjs.asec(1); // true\n\nmnjs.stn('123'); // 123\nmnjs.nts(123); // \"123\"\n\n/***** Matrices *****/\nmnjs.range(1, 10, 1); //  [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]\nmnjs.range(1, 10); //  [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]\nmnjs.range(10, 1, 1); //  [ 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]\nmnjs.range(10, 1); //  [ 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]\nmnjs.range(1, 5, 0.5); //  [ 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5 ]\nmnjs.range(1, 0, 0.2); //  [ 1, 0.8, 0.6, 0.4, 0.2, 0 ]\nmnjs.range(10, 1, 2); //  [ 10, 8, 6, 4, 2 ]\nmnjs.range(-20, 1, 0); //  Error: MNJS ERROR No. 02 : 01: The step parameter should not be:\n//  1/ null\n//  2/ equal or less than zero.\n//  3/ greater than the absolute difference between the first and second parameter\n\nmnjs.monolist(1, 5); //  [ 1, 1, 1, 1, 1 ]\nmnjs.monolist(0.5, 3); //  [ 0.5, 0.5, 0.5 ]\nmnjs.monolist(0, 5); //  [ 0, 0, 0, 0, 0 ]\nmnjs.monolist(-0.5, 3); //  [ -0.5, -0.5, -0.5 ]\nmnjs.monolist(-1, 5); //  [ -1, -1, -1, -1, -1 ]\nmnjs.monolist(5, 1.1); //  RangeError: Invalid array length\n\n// Most of the MNJS functions return a number or an array of numbers\n\nconst myArray = mnjs.range(0, 90, 30);\nconst errArray = [0, 30, '60', 90];\n\nmyArray; //  [ 0, 30, 60, 90 ]\nerrArray; //  [ 0, 30, '60', 90 ]\n\nmnjs.cube(myArray); // [ 0, 27000, 216000, 729000 ]\n\nmnjs.sin.deg(myArray[1]); // 0.5\nmnjs.sin.deg(myArray); // [ 0, 0.5, 0.866025403784439, 1 ]\n\nmnjs.abs(errArray); // Error: MNJS ERROR No. 01: This function accepting either a number or an array.\n// In the case of an array, all of its elements must be numbers.\nmnjs.dtr(myArray); // [ 0, 0.523598775598299, 1.047197551196598, 1.570796326794897 ]\n\n// Note the result may change in some functions depending on the position of the arguments\n\nmnjs.add(2, 2); //  4\nmnjs.add([0, 2], [4, 8]); //  [ 4, 10 ]\nmnjs.add([4, 8], [0, 2]); //  [ 4, 10 ]\nmnjs.add(2, [1, 2]); //  [ 3, 4 ]\nmnjs.add([1, 2], 2); //  [ 3, 4 ]\nmnjs.subt(2, [1, 2]); //  [ 1, 0 ]\nmnjs.subt([1, 2], 2); //  [ -1, 0 ]\nmnjs.subt([0, 2], [4, 8]); //  [ -4, -6 ]\nmnjs.subt([4, 8], [0, 2]); //  [ 4, 6 ]\nmnjs.mult(2, [1, 2]); //  [ 2, 4 ]\nmnjs.mult([1, 2], 2); //  [ 2, 4 ]\nmnjs.divi(2, [1, 2]); //  [ 2, 1 ]\nmnjs.divi([1, 2], 2); //  [ 0.5, 1 ]\nmnjs.divi([0, 2], [4, 8]); //  [ 0, 0.25 ]\nmnjs.divi([4, 8], [0, 2]); //  [ Infinity, 4 ]\nmnjs.add([2], [1, 2]); // Error: MNJS ERROR No. 01 : 03: This function accepting two arguments of numbers, arrays, or one of them must be a number, and the other must be an array; In the case of arrays, all elements must be a number, the length of arrays must be equal\n\nmnjs.pow(4, [1, 2, 3]); //  [ 4, 16, 64 ]\nmnjs.pow([1, 2, 3], 4); //  [ 1, 16, 81 ]\n\nmnjs.nrt(8, [1, 2, 3]); //  [ 8, 2.82842712474619, 2 ]\nmnjs.nrt([1, 2, 3], 8); //  [ 1, 1.090507732665258, 1.147202690439877 ]\nmnjs.nrt([1, 3], [3, 1]); //  [ 1, 3 ]\nmnjs.nrt([3, 1], [1, 3]); //  [ 3, 1 ]\n\nmnjs.mult(0.2, [5, 10, 15]); //  [ 1, 2, 3 ]\nmnjs.mult(0.2, mnjs.range(5, 15, 5)); //  [ 1, 2, 3 ]\nmnjs.mult([0.2, 0.2, 0.2], [5, 10, 15]); //  [ 1, 2, 3 ]\nmnjs.mult(mnjs.monolist(0.2, 3), [5, 10, 15]); //  [ 1, 2, 3 ]\nmnjs.mult(0.2, [5, 10, 15])[1] === mnjs.mult(mnjs.monolist(0.2, 3), [5, 10, 15])[1]; // true\n\nmnjs.imul(0xffffffff, [1, 2, 3, 4, 5]); //  [ -1, -2, -3, -4, -5 ]\nmnjs.rib(100000, 999999); //  returns random integer between two values, inclusive min and max value\n\n// Remember that:\n// 0 / 0 = NaN, NaN / NaN = NaN, Infinity / Infinity = NaN, Infinity / NaN = NaN\n// NaN / Infinity = NaN, 0 / NaN = NaN, NaN / 0 = Nan\n// 0 / Infinity = 0, Infinity / 0 = Infinity\n// Infinity === Infinity returns true. Infinity is equal to itself\n// Infinity \u003e Infinity, return false\n// NaN === NaN, NaN \u003e NaN, NaN \u003c NaN, returns false\n// Infinity === NaN, Infinity \u003e NaN, Infinity \u003c NaN, returns false\n\n// The change function replace x (number or numeric array element) with z if x = y\n// The change and change.isEqual functions are the same\n// mnjs.change(x=1, y=1, z=0)\nmnjs.change(1, 1, 0) === mnjs.change.isEqual(1, 1, 0); // returns true\nmnjs.change(1, 1, 0); //  returns 0\nmnjs.change(1, NaN, 0); //  returns 1\nmnjs.change(Infinity, Infinity, 0); //  returns 0\nmnjs.change([0, NaN, 1, Infinity], NaN, 0); //  returns [0, NaN, 1, Infinity]\n// where [0 = old value, NaN = old value, 1 = old value, Infinity = old value], nothing changed!\nmnjs.change([0, NaN, 1, Infinity], Infinity, 0); //  returns [0, NaN, 1, 0]\n// where [0 = old value, NaN = old value, 1 = old value, 0 = new value ], only Infinity value replaced with 0\n\n// The change.isNotEqual function replace x (number or numeric array element) with z if x is not equal to y\n// mnjs.change.isNotEqual(x=1, y=1, z=0)\nmnjs.change.isEqual(1, 1, 0) !== mnjs.change.isNotEqual(1, 1, 0); // returns true\nmnjs.change.isNotEqual(1, 1, 0); //  returns 1, where 1 is the old value of x\nmnjs.change.isNotEqual(1, NaN, 0); //  returns 0, where 0 is the new value of x\nmnjs.change.isNotEqual(Infinity, Infinity, 0); //  returns Infinity\nmnjs.change.isNotEqual([0, NaN, 1, Infinity], NaN, 0); //  returns [0, 0, 0, 0]\n// where [0 = new value, 0 = new value, 0 = new value, 0 = new value], all elements changed with new values!\nmnjs.change.isNotEqual([0, NaN, 1, Infinity], Infinity, 0); //  returns [0, 0, 0, Infinity]\n// where [0 = new value, 0 = new value, 0 = new value, Infinity = old value ], all elements replaced with 0 except Infinity\nmnjs.change.isGreater([0, NaN, 1, Infinity], NaN, 0); //  returns [0, NaN, 1, Infinity]\nmnjs.change.isLess([0, NaN, 1, Infinity], NaN, 0); //  returns [0, NaN, 1, Infinity]\nmnjs.change.isGreaterOrEqual([0, NaN, 1, Infinity], Infinity, 0); // returns [0, NaN, 1, 0]\n// where orEqual is true (Infinity replaced by 0)\nmnjs.change.isLessOrEqual([0, NaN, 1, Infinity], Infinity, 0); // returns [0, NaN, 0, 0]\n// change.isFiniteNum(x, y) or change.isFiniteNum(xArray, y)\nmnjs.change.isFiniteNum([0, NaN, 1, Infinity], Infinity); // returns [Infinity, NaN, Infinity, Infinity]\n// where [Infinity = new value, NaN = old value, Infinity = new value, Infinity = old value]\nmnjs.change.isInfinity([-Infinity, NaN, 1, Infinity], 0); // returns [0, NaN, 1, 0]  (change ±Infinity)\nmnjs.change.isPlusInfinity([-Infinity, NaN, 1, Infinity], 0); // returns [-Infinity, NaN, 1, 0]\nmnjs.change.isMinusInfinity([-Infinity, NaN, 1, Infinity], 0); // returns [0, NaN, 1, Infinity]\nmnjs.change.isNAN([-Infinity, NaN, 1, Infinity], 0); // returns [-Infinity, 0, 1, Infinity]\n\n// Fermat number\nmnjs.fermat(-1) or mnjs.fermat(1.2) // returns error\nmnjs.fermat(0) // returns 3\nmnjs.fermat([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) // returns [5, 17, 257, ..., 1.3407807929942597e+154, Infinity]\n```\n\n## Demo Projects\n\n---\n\n### Svelte Demo Project [https://svelte-mnjs-chartjs.vercel.app]\n\n---\n\n[![https://raw.githubusercontent.com/dr-montasir/public/main/mnjs/images/svelte-mnjs-chartjs.png](https://raw.githubusercontent.com/dr-montasir/public/main/mnjs/images/svelte-mnjs-chartjs.png)](https://svelte-mnjs-chartjs.vercel.app)\n\n---\n\n### React Demo Project [https://react-mnjs-plotlyjs.vercel.app]\n\n---\n\n[![https://raw.githubusercontent.com/dr-montasir/public/main/mnjs/images/react-mnjs-plotlyjs.png](https://raw.githubusercontent.com/dr-montasir/public/main/mnjs/images/react-mnjs-plotlyjs.png)](https://react-mnjs-plotlyjs.vercel.app)\n\n## MNJS Object Keys\n\n| Key                     | Definition                                                                                                                                                                                                                                        | Value                                                                            |\n| :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------- |\n| abs                     | The absolute value of a number                                                                                                                                                                                                                    | function: abs(num)                                                               |\n| add                     | Addition                                                                                                                                                                                                                                          | function: add(num1, num2)                                                        |\n| acos                    | Inverse cosine (in radians)                                                                                                                                                                                                                       | function: acos(num)                                                              |\n| acos.rad                | Inverse cosine (in radians)                                                                                                                                                                                                                       | function: acos.rad(num)                                                          |\n| acos.deg                | Inverse cosine (in degrees)                                                                                                                                                                                                                       | function: acos.deg(num)                                                          |\n| acosh                   | Inverse hyperbolic cosine (in radians)                                                                                                                                                                                                            | function: acosh(num)                                                             |\n| acosh.rad               | Inverse hyperbolic cosine (in radians)                                                                                                                                                                                                            | function: acosh.rad(num)                                                         |\n| acosh.deg               | Inverse hyperbolic cosine (in degrees)                                                                                                                                                                                                            | function: acosh.deg(num)                                                         |\n| acot                    | Inverse cotangent (in radians)                                                                                                                                                                                                                    | function: acot(num)                                                              |\n| acot.rad                | Inverse cotangent (in radians)                                                                                                                                                                                                                    | function: acot.rad(num)                                                          |\n| acot.deg                | Inverse cotangent (in degrees)                                                                                                                                                                                                                    | function: acot.deg(num)                                                          |\n| acoth                   | Inverse hyperbolic cotangent (in radians)                                                                                                                                                                                                         | function: acoth(num)                                                             |\n| acoth.rad               | Inverse hyperbolic cotangent (in radians)                                                                                                                                                                                                         | function: acoth.rad(num)                                                         |\n| acoth.deg               | Inverse hyperbolic cotangent (in degrees)                                                                                                                                                                                                         | function: acoth.deg(num)                                                         |\n| acsc                    | Inverse cosecant (in radians)                                                                                                                                                                                                                     | function: acsc(num)                                                              |\n| acsc.rad                | Inverse cosecant (in radians)                                                                                                                                                                                                                     | function: acsc.rad(num)                                                          |\n| acsc.deg                | Inverse cosecant (in degrees)                                                                                                                                                                                                                     | function: acsc.deg(num)                                                          |\n| acsch                   | Inverse hyperbolic cosecant (in radians)                                                                                                                                                                                                          | function: acsch(num)                                                             |\n| acsch.rad               | Inverse hyperbolic cosecant (in radians)                                                                                                                                                                                                          | function: acsch.rad(num)                                                         |\n| acsch.deg               | Inverse hyperbolic cosecant (in degrees)                                                                                                                                                                                                          | function: acsch.deg(num)                                                         |\n| asec                    | Inverse secant (in radians)                                                                                                                                                                                                                       | function: asec(num)                                                              |\n| asec.rad                | Inverse secant (in radians)                                                                                                                                                                                                                       | function: asec.rad(num)                                                          |\n| asec.deg                | Inverse secant (in degrees)                                                                                                                                                                                                                       | function: asec.deg(num)                                                          |\n| asech                   | Inverse hyperbolic secant (in radians)                                                                                                                                                                                                            | function: asech(num)                                                             |\n| asech.rad               | Inverse hyperbolic secant (in radians)                                                                                                                                                                                                            | function: asech.rad(num)                                                         |\n| asech.deg               | Inverse hyperbolic secant (in degrees)                                                                                                                                                                                                            | function: asech.deg(num)                                                         |\n| asin                    | Inverse sine (in radians)                                                                                                                                                                                                                         | function: asin(num)                                                              |\n| asin.rad                | Inverse sine (in radians)                                                                                                                                                                                                                         | function: asin.rad(num)                                                          |\n| asin.deg                | Inverse sine (in degrees)                                                                                                                                                                                                                         | function: asin.deg(num)                                                          |\n| asinh                   | Inverse hyperbolic sine (in radians)                                                                                                                                                                                                              | function: asinh(num)                                                             |\n| asinh.rad               | Inverse hyperbolic sine (in radians)                                                                                                                                                                                                              | function: asinh.rad(num)                                                         |\n| asinh.deg               | Inverse hyperbolic sine (in degrees)                                                                                                                                                                                                              | function: asinh.deg(num)                                                         |\n| atan                    | Inverse tangen (in radians)                                                                                                                                                                                                                       | function: atan(num)                                                              |\n| atan.rad                | Inverse tangen (in radians)                                                                                                                                                                                                                       | function: atan.rad(num)                                                          |\n| atan.deg                | Inverse tangen (in degrees)                                                                                                                                                                                                                       | function: atan.deg(num)                                                          |\n| atanh                   | Inverse hyperbolic tangen (in radians)                                                                                                                                                                                                            | function: atanh(num)                                                             |\n| atanh.rad               | Inverse hyperbolic tangen (in radians)                                                                                                                                                                                                            | function: atanh.rad(num)                                                         |\n| atanh.deg               | Inverse hyperbolic tangen (in degrees)                                                                                                                                                                                                            | function: atanh.deg(num)                                                         |\n| ceil                    | The ceil function returns the smallest integer greater than or equal to a number                                                                                                                                                                  | function: ceil(num)                                                              |\n| change                  | The change function replace x (number or numeric array element) with z if x = y                                                                                                                                                                   | function: change(x, y, z)                                                        |\n| change.isEqual          | The change.isEqual function replace x (number or numeric array element) with z if x = y                                                                                                                                                           | function: change.isEqual(x, y, z)                                                |\n| change.isNotEqual       | The change.isNotEqual replace x (number or numeric array element) with z if x is not equal to y                                                                                                                                                   | function: change.isNotEqual(x, y, z)                                             |\n| change.isGreater        | The change.isGreater replace x (number or numeric array element) with z if x is greater than y                                                                                                                                                    | function: change.isGreater(x, y, z)                                              |\n| change.isLess           | The change.isLess replace x (number or numeric array element) with z if x is less than y                                                                                                                                                          | function: change.isLess(x, y, z)                                                 |\n| change.isGreaterOrEqual | The change.isGreaterOrEqual replace x (number or numeric array element) with z if x is greater than or equal to y                                                                                                                                 | function: change.isGreaterOrEqua(x, y, z)                                        |\n| change.isLessOrEqual    | The change.isLess replace x (number or numeric array element) with z if x is less than y                                                                                                                                                          | function: change.isLessOrEqual(x, y, z)                                          |\n| change.isFiniteNum      | The change.isFiniteNum replace x (number or numeric array element) with y if x is finite                                                                                                                                                          | function: change.isFiniteNum(x,y)                                                |\n| change.isInfinity       | The change.isInfinity replace x (number or numeric array element) with y if x is infinity                                                                                                                                                         | function: change.isInfinity(x,y)                                                 |\n| change.isPlusInfinity   | The change.isPlusInfinity replace x (number or numeric array element) with y if x is plus infinity                                                                                                                                                | function: change.isPlusInfinity(x,y)                                             |\n| change.isMinusInfinity  | The change.isMinusInfinity replace x (number or numeric array element) with y if x is minus infinity                                                                                                                                              | function: change.isMinusInfinity(x,y)                                            |\n| change.isNAN            | The change.isNAN replace x (number or numeric array element) with y if x is NAN                                                                                                                                                                   | function: change.isNAN(x,y)                                                      |\n| cos                     | Cosine (in radians)                                                                                                                                                                                                                               | function: cos(angleRadians)                                                      |\n| cos.rad                 | Cosine (in radians)                                                                                                                                                                                                                               | function: cos.rad(angleRadians)                                                  |\n| cos.deg                 | Cosine (in degrees)                                                                                                                                                                                                                               | function: cos.deg(angleDegrees)                                                  |\n| cosh                    | Hyperbolic cosine (in radians)                                                                                                                                                                                                                    | function: cosh(angleRadians)                                                     |\n| cosh.rad                | Hyperbolic cosine (in radians)                                                                                                                                                                                                                    | function: cosh.rad(angleRadians)                                                 |\n| cosh.deg                | Hyperbolic cosine (in degrees)                                                                                                                                                                                                                    | function: cosh.deg(angleDegrees)                                                 |\n| csc                     | cosecant (or cosec)                                                                                                                                                                                                                               | function: csc(angleRadians)                                                      |\n| csc.rad                 | cosecant (or cosec)                                                                                                                                                                                                                               | function: csc.rad(angleRadians)                                                  |\n| csc.deg                 | Cosecant (in degrees)                                                                                                                                                                                                                             | function: csc.deg(angleDegrees)                                                  |\n| csch                    | Hyperbolic cosecant (or cosec)                                                                                                                                                                                                                    | function: csch(angleRadians)                                                     |\n| csch.rad                | Hyperbolic cosecant (or cosec)                                                                                                                                                                                                                    | function: csch.rad(angleRadians)                                                 |\n| csch.deg                | Hyperbolic cosecant (in degrees)                                                                                                                                                                                                                  | function: csch.deg(angleDegrees)                                                 |\n| cube                    | Cube (n)^3                                                                                                                                                                                                                                        | function: cube(num)                                                              |\n| cbrt                    | Cube Root                                                                                                                                                                                                                                         | function: cbrt(num)                                                              |\n| cot                     | Cotangent (or cotan or cotg or ctg or ctn). (in radians)                                                                                                                                                                                          | function: cot(angleRadians)                                                      |\n| cot.rad                 | Cotangent (or cotan or cotg or ctg or ctn). (in radians)                                                                                                                                                                                          | function: cot.rad(angleRadians)                                                  |\n| cot.deg                 | Cotangent (in degrees)                                                                                                                                                                                                                            | function: cot.deg(angleDegrees)                                                  |\n| coth                    | Hyperbolic cotangent (or cotan or cotg or ctg or ctn). (in radians)                                                                                                                                                                               | function: coth(angleRadians)                                                     |\n| coth.rad                | Hyperbolic cotangent (or cotan or cotg or ctg or ctn). (in radians)                                                                                                                                                                               | function: coth.rad(angleRadians)                                                 |\n| coth.deg                | Hyperbolic cotangent (in degrees)                                                                                                                                                                                                                 | function: coth.deg(angleDegrees)                                                 |\n| dtr                     | Degrees to Radians conversion                                                                                                                                                                                                                     | function: dtr(angleDegrees). Result in radians                                   |\n| divi                    | Division                                                                                                                                                                                                                                          | function: divi(numerator, denominator)                                           |\n| e                       | The Number e (Euler's number)                                                                                                                                                                                                                     | number: 2.718281828459045                                                        |\n| exp                     | The power of e (Euler's number)                                                                                                                                                                                                                   | function: exp(power)                                                             |\n| expm1                   | The expm1 function returns e^x - 1, where x is the argument, and e the base of the natural logarithms                                                                                                                                             | function: expm1(power)                                                           |\n| fermat                  | The fermat function accepting a non-negative integer                                                                                                                                                                                              | function: fermat(num)                                                            |\n| fix                     | Fix to the certain decimal point                                                                                                                                                                                                                  | function: fix(num, point)                                                        |\n| floor                   | The floor function returns the largest integer less than or equal to a given number                                                                                                                                                               | function: floor(num)                                                             |\n| fround                  | The fround function returns the nearest 32-bit single precision float representation of a Number                                                                                                                                                  | function: fround(num)                                                            |\n| hypot                   | The square root of the sum of squares                                                                                                                                                                                                             | function: hypot(num1, num2, ..., num) or function: hypot([num1, num2, ..., num]) |\n| imul                    | The imul function returns the result of the C-like 32-bit multiplication of the two parameters                                                                                                                                                    | function: imul(num1, num2)                                                       |\n| inv                     | The inverse of a number                                                                                                                                                                                                                           | function: inv(num)                                                               |\n| ln2                     | The natural logarithm of 2                                                                                                                                                                                                                        | number: 0.693147180559945                                                        |\n| ln10                    | The natural logarithm of 10                                                                                                                                                                                                                       | number: 2.302585092994046                                                        |\n| log                     | The Natural logarithm (base e) of a number                                                                                                                                                                                                        | function: log(x) is equivalent to _ln(x)_ in mathematics                         |\n| log1p                   | The natural logarithm (base e) of 1 + a number                                                                                                                                                                                                    | function: log1p(x)                                                               |\n| log2                    | The base 2 logarithm of a number                                                                                                                                                                                                                  | function: log2(x)                                                                |\n| log10                   | The base 10 logarithm of a number                                                                                                                                                                                                                 | function: log10(x)                                                               |\n| log2e                   | The base 2 logarithm of E                                                                                                                                                                                                                         | number: 1.4426950408889634                                                       |\n| log10e                  | The base 10 logarithm of E                                                                                                                                                                                                                        | number: 0.434294481903252                                                        |\n| max                     | Max function returns the largest-valued number                                                                                                                                                                                                    | function: max(num1, num2, ..., num) or max(array of numbers)                     |\n| min                     | Min function returns the lowest-valued number                                                                                                                                                                                                     | function: min(num1, num2, ..., num) or min(array of numbers)                     |\n| monolist                | The monolist function returns an array of numbers of _equal values_, specifying the element's _value_ and the _size_ of the array.                                                                                                                | function: monolist(value, size). It returns an array                             |\n| mult                    | Multiplication                                                                                                                                                                                                                                    | function: mult(num1, num2)                                                       |\n| nrt                     | N Root                                                                                                                                                                                                                                            | function: nrt(num, root), when root=n={1,2,..}                                   |\n| nts                     | Number to String conversion                                                                                                                                                                                                                       | function: nts(num). Result as string                                             |\n| pi                      | The Number pi (π)                                                                                                                                                                                                                                 | number: 3.141592653589793                                                        |\n| phi                     | The Golden Ratio (Phi)                                                                                                                                                                                                                            | number: 1.618033988749895                                                        |\n| pow                     | power                                                                                                                                                                                                                                             | function: pow(num, power)                                                        |\n| range                   | The range function returns a sequence of numbers, starting from _start_ value by default, and increments or decrements by _step_ value, and stops before or in specified _end_ value.                                                             | function: range(start, end, step). It returns an array                           |\n| rem                     | The remainder function (%) returns the remainder or signed remainder of a division, after one number is divided by another (called the modulus of the operation)                                                                                  | function: rem(num1, num2)                                                        |\n| rib                     | The rib function returns a random integer between two values, inclusive min and max value                                                                                                                                                         | function: rib(min, max)                                                          |\n| round                   | The round function returns the value of a number rounded to the nearest integer                                                                                                                                                                   | function: round(num)                                                             |\n| rtd                     | Radians to Degrees conversion                                                                                                                                                                                                                     | function: rtd(angleRadians). Result in degrees                                   |\n| sec                     | Secant (in radians)                                                                                                                                                                                                                               | function: sec(angleRadians)                                                      |\n| sec.rad                 | Secant (in radians)                                                                                                                                                                                                                               | function: sec.rad(angleRadians)                                                  |\n| sec.deg                 | Secant (in degrees)                                                                                                                                                                                                                               | function: sec.deg(angleDegrees)                                                  |\n| sech                    | Hyperbolic secant (in radians)                                                                                                                                                                                                                    | function: sech(angleRadians)                                                     |\n| sech.rad                | Hyperbolic secant (in radians)                                                                                                                                                                                                                    | function: sech.rad(angleRadians)                                                 |\n| sech.deg                | Hyperbolic secant (in degrees)                                                                                                                                                                                                                    | function: sech.deg(angleDegrees)                                                 |\n| sign                    | The sign function (+, -)                                                                                                                                                                                                                          | function: sign(num). It returns -1, -0, 0, 1                                     |\n| sin                     | Sine (in radians)                                                                                                                                                                                                                                 | function: sin(angleRadians)                                                      |\n| sin.rad                 | Sine (in radians)                                                                                                                                                                                                                                 | function: sin.rad(angleRadians)                                                  |\n| sin.deg                 | Sine (in degrees)                                                                                                                                                                                                                                 | function: sin.deg(angleDegrees)                                                  |\n| sinh                    | Hyperbolic sine (in radians)                                                                                                                                                                                                                      | function: sinh(angleRadians)                                                     |\n| sinh.rad                | Hyperbolic sine (in radians)                                                                                                                                                                                                                      | function: sinh.rad(angleRadians)                                                 |\n| sinh.deg                | Hyperbolic sine (in degrees)                                                                                                                                                                                                                      | function: sinh.deg(angleDegrees)                                                 |\n| sqr                     | Square                                                                                                                                                                                                                                            | function: sqr(num)                                                               |\n| sqrt                    | Square Root                                                                                                                                                                                                                                       | function: sqrt(num)                                                              |\n| stn                     | String to Number conversion                                                                                                                                                                                                                       | function: stn(str). Result as number                                             |\n| subt                    | Subtraction                                                                                                                                                                                                                                       | function: subt(num1, num2)                                                       |\n| sum                     | The Sum Function, Also Called The Reducer Function. The final result of running the sum function across all elements of the array is a single value. The first argument should be one (numeric or empty) array and the second should be a number. | function: sum(Array, number) or sum(Array), number=0                             |\n| tan                     | Tangent (in radians)                                                                                                                                                                                                                              | function: tan(angleRadians)                                                      |\n| tan.rad                 | Tangent (in radians)                                                                                                                                                                                                                              | function: tan.rad(angleRadians)                                                  |\n| tan.deg                 | Tangen (in degrees)                                                                                                                                                                                                                               | function: tan.deg(angleDegrees)                                                  |\n| tanh                    | Hyperbolic tangent (in radians)                                                                                                                                                                                                                   | function: tanh(angleRadians)                                                     |\n| tanh.rad                | Hyperbolic tangent (in radians)                                                                                                                                                                                                                   | function: tanh.rad(angleRadians)                                                 |\n| tanh.deg                | Hyperbolic tangent (in degrees)                                                                                                                                                                                                                   | function: tanh.deg(angleDegrees)                                                 |\n| tau                     | The tau constant (2 x pi)                                                                                                                                                                                                                         | number: 6.283185307179586                                                        |\n| trunc                   | Returns the integer part of a number                                                                                                                                                                                                              | function: trunc(num)                                                             |\n| zeros                   | Add .00 to number                                                                                                                                                                                                                                 | function: zeros(num, point). Result as string                                    |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdr-montasir%2Fmnjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdr-montasir%2Fmnjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdr-montasir%2Fmnjs/lists"}