{"id":20985781,"url":"https://github.com/davidmartinez10/bigfloat-deno","last_synced_at":"2026-04-11T07:45:31.229Z","repository":{"id":62420917,"uuid":"215518070","full_name":"davidmartinez10/bigfloat-deno","owner":"davidmartinez10","description":"A library for arbitrary precision decimal floating point arithmetic.","archived":false,"fork":false,"pushed_at":"2020-10-12T01:52:54.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-05T20:28:19.129Z","etag":null,"topics":["arbitrary-precision","arithmetic","bigdecimal","bigfloat","bigfloat-deno","bigint","bignumber","business","cryptocurrency","decimal","deno","floating-point","mathematics","nodejs","physics","precision","typescript"],"latest_commit_sha":null,"homepage":"https://deno.land/x/bigfloat","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/davidmartinez10.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":"2019-10-16T10:12:31.000Z","updated_at":"2021-03-15T13:41:53.000Z","dependencies_parsed_at":"2022-11-01T17:30:56.440Z","dependency_job_id":null,"html_url":"https://github.com/davidmartinez10/bigfloat-deno","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/davidmartinez10/bigfloat-deno","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmartinez10%2Fbigfloat-deno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmartinez10%2Fbigfloat-deno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmartinez10%2Fbigfloat-deno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmartinez10%2Fbigfloat-deno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidmartinez10","download_url":"https://codeload.github.com/davidmartinez10/bigfloat-deno/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidmartinez10%2Fbigfloat-deno/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31673067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["arbitrary-precision","arithmetic","bigdecimal","bigfloat","bigfloat-deno","bigint","bignumber","business","cryptocurrency","decimal","deno","floating-point","mathematics","nodejs","physics","precision","typescript"],"created_at":"2024-11-19T06:10:13.018Z","updated_at":"2026-04-11T07:45:31.212Z","avatar_url":"https://github.com/davidmartinez10.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![BigFloat](https://raw.githubusercontent.com/davidmartinez10/bigfloat-esnext/master/bigfloat.jpg)](https://github.com/davidmartinez10/bigfloat-deno)\n\nA library for arbitrary precision decimal floating point arithmetic that can exactly represent all decimal fractions,\nunlike JavaScript's number data type which is 64-bit binary floating point.\n\nBased on the original work by Douglas Crockford.\nThis implementation is built upon ES native bigints.\n\nThis library provides three ways to make bigfloat operations:\n  - A set of functions for a functional style approach\n  - A BigFloat class with an API similar to that of Decimal.js\n  - An evaluate() function that parses and resolves an expression\n\n# Basic usage\n### Functional style\n```typescript\nimport { make, string, sqrt } from \"https://deno.land/x/bigfloat/mod.ts\";\n\nstring(sqrt(make(\"2\")));               // \"1.4142\"\n```\n\n### Class based\n```typescript\nimport { BigFloat } from \"https://deno.land/x/bigfloat/mod.ts\";\n\nnew BigFloat(\"2\").sqrt().toString();   // \"1.4142\"\n```\n\n### The evaluate() function\n```typescript\nevaluate(expression: string, precision?: number): string | boolean\n```\n\u003eThe first argument can be any valid arithmetic or relational expression, including scientific e-notation.\n\u003ePrecision should be a negative integer. Default is -4.\n```typescript\nimport { evaluate } from \"https://deno.land/x/bigfloat/mod.ts\";\n\n0.1 + 0.2 === 0.3;                     // false\nevaluate(\"0.1 + 0.2 == 0.3\");          // true\n\n0.1 + 0.2;                             // 0.30000000000000004\nevaluate(\"0.1 + 0.2\");                 // \"0.3\"\n\n1 + Number.EPSILON / 2;                // 1\nevaluate(`1 + ${Number.EPSILON / 2}`); // \"1.00000000000000011102230246251565\"\n\nevaluate(\"1 + 2.220446049250313e-16\"); // \"1.0000000000000002220446049250313\"\n\nevaluate(`4 \u003e= ${Math.PI}`);           // true\n```\n\nValid tokens:\n  - Parenthesis: (,)\n  - Number: Decimal, integer or scientific e-notation\n  - Operator: Arithmetic +,-,/,*,** Relational =\\=\\=,=\\=,!==,!=,\u003c,\u003e,\u003c=,\u003e=\n\n### Change precision\n```typescript\nimport { BigFloat, set_precision } from \"https://deno.land/x/bigfloat/mod.ts\";\n\nnew BigFloat(2).sqrt().toString();     // \"1.4142\"\nset_precision(-10);\nnew BigFloat(2).sqrt().toString();     // \"1.4142135623\"\n```\n\n### The bigfloat object\n```typescript\ninterface IBigFloat {\n  coefficient: bigint;\n  exponent: number;\n}\n```\n\nValid bigfloat made from primitives:\n```typescript\nconst bigfloat: IBigFloat {\n  coefficient: 522299n,\n  exponent: -4\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidmartinez10%2Fbigfloat-deno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidmartinez10%2Fbigfloat-deno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidmartinez10%2Fbigfloat-deno/lists"}