{"id":21831403,"url":"https://github.com/nodef/extra-bigint","last_synced_at":"2025-10-18T19:17:31.553Z","repository":{"id":40714896,"uuid":"274701321","full_name":"nodef/extra-bigint","owner":"nodef","description":"A BigInt can represent whole numbers larger than 2⁵³ - 1.","archived":false,"fork":false,"pushed_at":"2025-04-08T17:17:32.000Z","size":341,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T07:07:44.392Z","etag":null,"topics":["abs","aliquot-sum","arithmetic-mean","big","bigint","binomial","cbrt","ceil-div","compare","constrain","cubic-mean","extra","factorial","floor-div","gcd","geometric-mean","harmonic-mean","hypot","integer","is"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/extra-bigint","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/nodef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-24T15:17:10.000Z","updated_at":"2025-04-08T17:17:33.000Z","dependencies_parsed_at":"2024-06-19T00:20:49.645Z","dependency_job_id":"9c6a6f30-7094-458d-a35d-45966553c894","html_url":"https://github.com/nodef/extra-bigint","commit_stats":{"total_commits":103,"total_committers":3,"mean_commits":"34.333333333333336","dds":0.03883495145631066,"last_synced_commit":"0b88d902d58145c61f7f509cd580d319fe52ef05"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-bigint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-bigint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-bigint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-bigint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodef","download_url":"https://codeload.github.com/nodef/extra-bigint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837280,"owners_count":21169374,"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":["abs","aliquot-sum","arithmetic-mean","big","bigint","binomial","cbrt","ceil-div","compare","constrain","cubic-mean","extra","factorial","floor-div","gcd","geometric-mean","harmonic-mean","hypot","integer","is"],"created_at":"2024-11-27T19:10:16.410Z","updated_at":"2025-10-18T19:17:26.505Z","avatar_url":"https://github.com/nodef.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"A [BigInt] can represent whole numbers larger than 2⁵³ - 1 [(1)].\u003cbr\u003e\n📦 [Node.js](https://www.npmjs.com/package/extra-bigint),\n🌐 [Web](https://www.npmjs.com/package/extra-bigint.web),\n📜 [Files](https://unpkg.com/extra-bigint/),\n📰 [Docs](https://nodef.github.io/extra-bigint/),\n📘 [Wiki](https://github.com/nodef/extra-bigint/wiki/).\n\n*ES2020* introduced **BigInt** as a built-in object. **BigInt** enables us to\nrepresent integers with arbitrary precision, allowing us to perform mathematical\noperations on large integers [(2)]. This package includes common bigint\nfunctions related to querying **about** numbers, **comparing** numbers,\nperforming **rounded division**, performing **modulo** operations, **controlling**\n**range** of numbers, performing **arithmetic** operations, obtaining **divisors**\nof a number (and related operations), getting the number of possible\n**arrangements** of a set of objects, performing **geometry**-related\ncalculations, performing basic **statistical** analysis, and finding various\n**statistical means**.\n\nThis package is available in *Node.js* and *Web* formats. To use it on the web,\nsimply use the `extra_bigint` global variable after loading with a `\u003cscript\u003e`\ntag from the [jsDelivr CDN].\n\n\u003e Stability: [Experimental](https://www.youtube.com/watch?v=L1j93RnIxEo).\n\n[BigInt]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt\n[(1)]: https://www.geeksforgeeks.org/bigint-in-javascript/\n[(2)]: https://www.smashingmagazine.com/2019/07/essential-guide-javascript-newest-data-type-bigint/\n[jsDelivr CDN]: https://cdn.jsdelivr.net/npm/extra-bigint.web/index.js\n\n\u003cbr\u003e\n\n```javascript\nconst xbigint = require('extra-bigint');\n// import * as xbigint from \"extra-bigint\";\n// import * as xbigint from \"https://unpkg.com/extra-bigint/index.mjs\"; (deno)\n\nxbigint.isPrime(113n);\n// → true\n\nxbigint.floorDiv(7n, 3n);\n// → 2n\n\nxbigint.sqrt(81n);\n// → 9n\n\nxbigint.lcm(2n, 3n, 4n);\n// → 12n\n\nxbigint.log2(8n);\n// → 3n\n\nxbigint.sum(1n, 2n, 3n, 4n);\n// → 10n\n\nxbigint.mean(1n, 7n, 8n);\n// → 5n\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n## Index\n\n| Property | Description |\n|  ----  |  ----  |\n| [is] | Check if value is a bigint. |\n|  |  |\n| [compare] | Compare two bigints. |\n|  |  |\n| [abs] | Get the absolute of a bigint. |\n| [sign] | Get the sign of a bigint. |\n|  |  |\n| [floorDiv] | Perform floor-divison of two bigints (\\\\). |\n| [ceilDiv] | Perform ceiling-divison of two bigints. |\n| [roundDiv] | Perform rounded-divison of two bigints. |\n|  |  |\n| [rem] | Find the remainder of x/y with sign of x (truncated division). |\n| [mod] | Find the remainder of x/y with sign of y (floored division). |\n| [modp] | Find the remainder of x/y with +ve sign (euclidean division). |\n|  |  |\n| [constrain] | Constrain a bigint within a minimum and a maximum value. |\n| [remap] | Re-map a bigint from one range to another. |\n| [lerp] | Linearly interpolate a bigint between two bigints. |\n|  |  |\n| [isPow2] | Check if bigint is a power-of-2. |\n| [isPow10] | Check if bigint is a power-of-10. |\n| [prevPow2] | Find largest power-of-2 less than or equal to given bigint. |\n| [prevPow10] | Find largest power-of-10 less than or equal to given bigint. |\n| [nextPow2] | Find smallest power-of-2 greater than or equal to given bigint. |\n| [nextPow10] | Find smallest power-of-10 greater than or equal to given bigint. |\n| [log2] | Find the base-2 logarithm of a bigint. |\n| [log10] | Find the base-10 logarithm of a bigint. |\n|  |  |\n| [sqrt] | Find the square root of a bigint. |\n| [cbrt] | Find the cube root of a bigint. |\n| [root] | Find the nth root of a bigint. |\n|  |  |\n| [properDivisors] | List all divisors of a bigint, except itself. |\n| [aliquotSum] | Sum all proper divisors of a bigint. |\n| [minPrimeFactor] | Find the least prime number which divides a bigint. |\n| [maxPrimeFactor] | Find the greatest prime number which divides a bigint. |\n| [primeFactors] | Find the prime factors of a bigint. |\n| [primeExponentials] | Find the prime factors and respective exponents of a bigint. |\n| [isPrime] | Check if bigint is prime. |\n| [gcd] | Find the greatest common divisor of bigints. |\n| [lcm] | Find the least common multiple of bigints. |\n|  |  |\n| [factorial] | Find the factorial of a bigint. |\n| [binomial] | Find the number of ways to choose k elements from a set of n elements. |\n| [multinomial] | Find the number of ways to put n objects in m bins (n=sum(kᵢ)). |\n|  |  |\n| [hypot] | Find the length of hypotenuse. |\n|  |  |\n| [sum] | Find the sum of bigints (Σ). |\n| [product] | Find the product of bigints (∏). |\n| [median] | Find the value separating the higher and lower halves of bigints. |\n| [modes] | Find the values that appear most often. |\n| [min] | Find the smallest bigint. |\n| [max] | Find the largest bigint. |\n| [range] | Find the minimum and maximum bigint. |\n| [variance] | Find the mean of squared deviation of bigints from its mean. |\n|  |  |\n| [arithmeticMean] | Find the arithmetic mean of bigints (µ). |\n| [geometricMean] | Find the geometric mean of bigints. |\n| [harmonicMean] | Find the harmonic mean of bigints. |\n| [quadriaticMean] | Find the quadriatic mean of bigints. |\n| [cubicMean] | Find the cubic mean of bigints. |\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n[![](https://img.youtube.com/vi/RJS3Z2DYEO4/maxresdefault.jpg)](https://www.youtube.com/watch?v=RJS3Z2DYEO4)\u003cbr\u003e\n[![ORG](https://img.shields.io/badge/org-nodef-green?logo=Org)](https://nodef.github.io)\n[![DOI](https://zenodo.org/badge/274701321.svg)](https://zenodo.org/badge/latestdoi/274701321)\n[![Coverage Status](https://coveralls.io/repos/github/nodef/extra-bigint/badge.svg?branch=master)](https://coveralls.io/github/nodef/extra-bigint?branch=master)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/7efb0a005561ff8b1df7/test_coverage)](https://codeclimate.com/github/nodef/extra-bigint/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/7efb0a005561ff8b1df7/maintainability)](https://codeclimate.com/github/nodef/extra-bigint/maintainability)\n![](https://ga-beacon.deno.dev/G-RC63DPBH3P:SH3Eq-NoQ9mwgYeHWxu7cw/github.com/nodef/extra-bigint)\n\n[is]: https://github.com/nodef/extra-bigint/wiki/is\n[compare]: https://github.com/nodef/extra-bigint/wiki/compare\n[abs]: https://github.com/nodef/extra-bigint/wiki/abs\n[sign]: https://github.com/nodef/extra-bigint/wiki/sign\n[floorDiv]: https://github.com/nodef/extra-bigint/wiki/floorDiv\n[ceilDiv]: https://github.com/nodef/extra-bigint/wiki/ceilDiv\n[roundDiv]: https://github.com/nodef/extra-bigint/wiki/roundDiv\n[rem]: https://github.com/nodef/extra-bigint/wiki/rem\n[mod]: https://github.com/nodef/extra-bigint/wiki/mod\n[modp]: https://github.com/nodef/extra-bigint/wiki/modp\n[constrain]: https://github.com/nodef/extra-bigint/wiki/constrain\n[remap]: https://github.com/nodef/extra-bigint/wiki/remap\n[lerp]: https://github.com/nodef/extra-bigint/wiki/lerp\n[isPow2]: https://github.com/nodef/extra-bigint/wiki/isPow2\n[isPow10]: https://github.com/nodef/extra-bigint/wiki/isPow10\n[prevPow2]: https://github.com/nodef/extra-bigint/wiki/prevPow2\n[prevPow10]: https://github.com/nodef/extra-bigint/wiki/prevPow10\n[nextPow2]: https://github.com/nodef/extra-bigint/wiki/nextPow2\n[nextPow10]: https://github.com/nodef/extra-bigint/wiki/nextPow10\n[log2]: https://github.com/nodef/extra-bigint/wiki/log2\n[log10]: https://github.com/nodef/extra-bigint/wiki/log10\n[sqrt]: https://github.com/nodef/extra-bigint/wiki/sqrt\n[cbrt]: https://github.com/nodef/extra-bigint/wiki/cbrt\n[root]: https://github.com/nodef/extra-bigint/wiki/root\n[properDivisors]: https://github.com/nodef/extra-bigint/wiki/properDivisors\n[aliquotSum]: https://github.com/nodef/extra-bigint/wiki/aliquotSum\n[minPrimeFactor]: https://github.com/nodef/extra-bigint/wiki/minPrimeFactor\n[maxPrimeFactor]: https://github.com/nodef/extra-bigint/wiki/maxPrimeFactor\n[primeFactors]: https://github.com/nodef/extra-bigint/wiki/primeFactors\n[primeExponentials]: https://github.com/nodef/extra-bigint/wiki/primeExponentials\n[isPrime]: https://github.com/nodef/extra-bigint/wiki/isPrime\n[gcd]: https://github.com/nodef/extra-bigint/wiki/gcd\n[lcm]: https://github.com/nodef/extra-bigint/wiki/lcm\n[factorial]: https://github.com/nodef/extra-bigint/wiki/factorial\n[binomial]: https://github.com/nodef/extra-bigint/wiki/binomial\n[multinomial]: https://github.com/nodef/extra-bigint/wiki/multinomial\n[hypot]: https://github.com/nodef/extra-bigint/wiki/hypot\n[sum]: https://github.com/nodef/extra-bigint/wiki/sum\n[product]: https://github.com/nodef/extra-bigint/wiki/product\n[median]: https://github.com/nodef/extra-bigint/wiki/median\n[modes]: https://github.com/nodef/extra-bigint/wiki/modes\n[min]: https://github.com/nodef/extra-bigint/wiki/min\n[max]: https://github.com/nodef/extra-bigint/wiki/max\n[range]: https://github.com/nodef/extra-bigint/wiki/range\n[variance]: https://github.com/nodef/extra-bigint/wiki/variance\n[arithmeticMean]: https://github.com/nodef/extra-bigint/wiki/arithmeticMean\n[geometricMean]: https://github.com/nodef/extra-bigint/wiki/geometricMean\n[harmonicMean]: https://github.com/nodef/extra-bigint/wiki/harmonicMean\n[quadriaticMean]: https://github.com/nodef/extra-bigint/wiki/quadriaticMean\n[cubicMean]: https://github.com/nodef/extra-bigint/wiki/cubicMean\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodef%2Fextra-bigint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodef%2Fextra-bigint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodef%2Fextra-bigint/lists"}