{"id":16294072,"url":"https://github.com/axetroy/deno_math","last_synced_at":"2025-03-20T04:30:26.149Z","repository":{"id":38276437,"uuid":"186331212","full_name":"axetroy/deno_math","owner":"axetroy","description":"Deno module for high-precision calculations and scientific computing","archived":false,"fork":false,"pushed_at":"2020-06-27T05:41:38.000Z","size":1162,"stargazers_count":22,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T07:49:39.952Z","etag":null,"topics":["deno"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axetroy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-13T02:23:27.000Z","updated_at":"2023-12-26T05:26:13.000Z","dependencies_parsed_at":"2022-08-18T07:16:04.317Z","dependency_job_id":null,"html_url":"https://github.com/axetroy/deno_math","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axetroy%2Fdeno_math","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axetroy%2Fdeno_math/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axetroy%2Fdeno_math/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axetroy%2Fdeno_math/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axetroy","download_url":"https://codeload.github.com/axetroy/deno_math/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244047647,"owners_count":20389206,"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":["deno"],"created_at":"2024-10-10T20:14:02.500Z","updated_at":"2025-03-20T04:30:25.767Z","avatar_url":"https://github.com/axetroy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/axetroy/deno_math/workflows/ci/badge.svg?branch=master)](https://github.com/axetroy/deno_math/actions)\n\n# math\n\nThe math module is used to provide a helper for high-precision calculations and scientific computing.\n\n## Usage\n\nAll the following modules are exposed in `mod.ts`\n\n## Big\n\nA class for high-precision calculations.\n\n```ts\nimport { Big } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nnew Big(0.1).plus(0.2).toString(); // '0.3'\n```\n\n[Documentation](big/README.md)\n\n## Matrix\n\nA class for `Matrix` computing.\n\n```ts\nimport { Matrix } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nconst m = new Matrix([\n  [1, 2, 3],\n  [4, 5, 6]\n]).transpose();\n\nconsole.log(m.toString());\n/**\n1, 4\n2, 5\n3, 6\n*/\n```\n\n[Documentation](matrix/README.md)\n\n### abs\n\nget a numeric absolute value.\n\n```ts\nimport { abs } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nabs(-1); // '1'\nabs(\"-0.1\"); // '0.1'\n```\n\n### min\n\nget a smaller numeric from a numeric set. Similar to `Math.min`.\n\n```ts\nimport { min } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nmin([-1, 0, \"1\"]); // '-1'\n```\n\n### max\n\nget a larger numeric from a numeric set. Similar to `Math.max`.\n\n```ts\nimport { max } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nmax([-1, 0, \"1\"]); // '1'\n```\n\n### sum\n\nget the sum of a numeric set.\n\n```ts\nimport { sum } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nsum([1, \"2\", 3]); // '6'\n```\n\n### plus\n\nget the value of `a numeric` plus `another numeric`. Similar to Javascript `+` operator.\n\n```ts\nimport { plus } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nplus(\"1\", 2); // '3'\n```\n\n### minus\n\nget the value of `a numeric` minus `another numeric`. Similar to Javascript `-` operator.\n\n```ts\nimport { minus } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nminus(\"1\", 2); // '-1'\n```\n\n### times\n\nget the value of `a numeric` times `another numeric`. Similar to Javascript `*` operator.\n\n```ts\nimport { times } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\ntimes(\"1\", 2); // '2'\n```\n\n### div\n\nget the value of `a numeric` divided `another numeric`. Similar to Javascript `/` operator.\n\n```ts\nimport { div } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\ndiv(\"1\", 2); // '0.5'\n```\n\n### mod\n\nget the value of `a numeric` modulo `another numeric`. Similar to Javascript `%` operator.\n\n```ts\nimport { mod } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nmod(\"3\", 2); // '1'\n```\n\n### pow\n\nget the value of `a numeric` raised to the power `another numeric`. Similar to `Math.pow`.\n\n```ts\nimport { pow } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\npow(\"3\", 2); // '9'\n```\n\n### sqrt\n\nget the value is the square root of `a numeric`. Similar to `Math.sqrt`.\n\n```ts\nimport { sqrt } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nsqrt(\"3\", 2); // '1.7320508075688772'\n```\n\n### round\n\nget the value of input rounded using rounding mode `rm` to a maximum of `dp` decimal places. Similar to `Math.round`.\n\n```ts\nimport { round } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nround(\"3.456\", 2); // '3.46'\n```\n\n### toExponential\n\nget an exponential notation string from `a numeric`. Similar to `Number.prototype.toExponential`.\n\n```ts\nimport { toExponential } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\ntoExponential(\"3.456\", 2); // '3.46e+0'\n```\n\n### toFixed\n\nget a normal notation string from `a numeric`. Similar to `Number.prototype.toFixed`.\n\n```ts\nimport { toFixed } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\ntoFixed(\"3.4\", 6); // '3.400000'\n```\n\n### toPrecision\n\nget the value of `a numeric` to the specified number of `sd` significant digits. Similar to `Number.prototype.toPrecision`.\n\n```ts\nimport { toPrecision } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\ntoPrecision(\"3.4567890\", 6); // '3.456789'\n```\n\n### eq\n\nWhere `a numeric` equal to `another numeric`. Similar to Javascript `===` operator.\n\n```ts\nimport { eq } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\neq(\"1.200\", \"1.2e+0\"); // true\n```\n\n### gt\n\nWhere `a numeric` greater than `another numeric`. Similar to Javascript `\u003e` operator.\n\n```ts\nimport { gt } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\ngt(2, \"1\"); // true\n```\n\n### gte\n\nWhere `a numeric` greater than or equal to `another numeric`. Similar to Javascript `\u003e=` operator.\n\n```ts\nimport { gte } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\ngte(2, \"1\"); // true\ngte(2, \"2\"); // true\ngte(2, \"3\"); // false\n```\n\n### lt\n\nWhere `a numeric` less than `another numeric`. Similar to Javascript `\u003c` operator.\n\n```ts\nimport { lt } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nlt(2, \"1\"); // false\nlt(2, \"2\"); // false\nlt(2, \"3\"); // false\n```\n\n### lte\n\nWhere `a numeric` less than or equal to `another numeric`. Similar to Javascript `\u003c=` operator.\n\n```ts\nimport { lte } from \"https://deno.land/x/math@v1.1.0/mod.ts\";\n\nlte(2, \"1\"); // false\nlte(2, \"2\"); // true\nlte(2, \"3\"); // false\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxetroy%2Fdeno_math","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxetroy%2Fdeno_math","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxetroy%2Fdeno_math/lists"}