{"id":21372843,"url":"https://github.com/veprogames/lua-big-number","last_synced_at":"2025-04-15T15:05:33.366Z","repository":{"id":59479211,"uuid":"537496869","full_name":"veprogames/lua-big-number","owner":"veprogames","description":"Simple Big Number library for Lua (at least ~ee14)","archived":false,"fork":false,"pushed_at":"2022-10-30T08:40:30.000Z","size":32,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T15:05:26.665Z","etag":null,"topics":["library","lua"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/veprogames.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":"2022-09-16T14:37:33.000Z","updated_at":"2025-03-02T10:02:12.000Z","dependencies_parsed_at":"2023-01-20T23:46:07.070Z","dependency_job_id":null,"html_url":"https://github.com/veprogames/lua-big-number","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veprogames%2Flua-big-number","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veprogames%2Flua-big-number/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veprogames%2Flua-big-number/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veprogames%2Flua-big-number/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/veprogames","download_url":"https://codeload.github.com/veprogames/lua-big-number/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249094931,"owners_count":21211837,"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":["library","lua"],"created_at":"2024-11-22T08:23:22.335Z","updated_at":"2025-04-15T15:05:33.341Z","avatar_url":"https://github.com/veprogames.png","language":"Lua","readme":"# lua-big-number\n\nA simple big number library for Lua, inspired by https://github.com/Patashu/break_infinity.js\n\n## Features\n\n1. floating-point precision in the range [~e-e14 - ~ee14]\n2. Hard limit should be about ee308, or 10^2¹⁰²⁴\n3. method names identical or very similar to https://github.com/Patashu/break_infinity.js\n4. non-mutable methods -\u003e easy chaining `Big:new(2):add(Big:new(2)):mul(Big:new(2))`\n5. Operator overloading `Big:new(3) * Big:new(5) ^ 2`\n\n## Usage\n\n1. Add `bignumber.lua` into your project\n2. `Big = dofile(\"/path/to/bignumber.lua\")`\n\n## Example\n\n```lua\nBig = dofile(\"lua-big-number/bignumber.lua\")\n\nlocal big1 = Big:new(100)\nlocal big2 = Big:new(10)\nlocal added = big1:add(big2)\nprint(added) -- will output 1.1e2\nprint(big1 * big2) -- will output 1.0e3\nprint(big1 + (big1 * big2 - big2) / (big1 ^ 0.4)) -- will output 2.5690442605365e2\n\n-- comparisons\nprint(big1 \u003e big2) -- true\nprint(big1 == big2) -- false\n\n-- You can define a shorthand for Big:new()\nlocal N = function(n) return Big:new(n) end\n\nprint(N(2) ^ 4096 / N(\"4.3e401\")) -- 2.4288113521237e831\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveprogames%2Flua-big-number","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fveprogames%2Flua-big-number","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveprogames%2Flua-big-number/lists"}