{"id":32307452,"url":"https://github.com/serdimoa/big.dart","last_synced_at":"2026-02-20T09:31:49.787Z","repository":{"id":56826564,"uuid":"422256880","full_name":"serdimoa/big.dart","owner":"serdimoa","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-17T17:24:31.000Z","size":6345,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T07:27:31.994Z","etag":null,"topics":["big","bignumber","dart","flutter"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/serdimoa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-10-28T15:26:48.000Z","updated_at":"2024-04-24T14:48:42.000Z","dependencies_parsed_at":"2022-09-20T22:10:53.422Z","dependency_job_id":null,"html_url":"https://github.com/serdimoa/big.dart","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/serdimoa/big.dart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serdimoa%2Fbig.dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serdimoa%2Fbig.dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serdimoa%2Fbig.dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serdimoa%2Fbig.dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serdimoa","download_url":"https://codeload.github.com/serdimoa/big.dart/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serdimoa%2Fbig.dart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29647670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["big","bignumber","dart","flutter"],"created_at":"2025-10-23T07:18:12.163Z","updated_at":"2026-02-20T09:31:49.782Z","avatar_url":"https://github.com/serdimoa.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"A small library for arbitrary-precision decimal arithmetic inspired by [big.js](https://github.com/MikeMcl/big.js/)\n\n[![Coverage Status](https://coveralls.io/repos/github/serdimoa/big.dart/badge.svg)](https://coveralls.io/github/serdimoa/big.dart)\n![build](https://github.com/serdimoa/big.dart/workflows/big.dart/badge.svg)\n[![style: dart lint recommended](https://img.shields.io/badge/style-lints_recommended-40c4ff.svg)](https://pub.dev/packages/lints)\n[![License: MIT](https://img.shields.io/badge/license-MIT-purple.svg)](https://opensource.org/licenses/MIT)\n\n\n## Features\n\n- Simple API\n- Easier-to-use\n- Replicates the `toStringAsExponential`, `toStringAsFixed` and `toStringAsPrecision` methods of Dart Numbers\n- Stores values in an accessible decimal floating point format\n- Comprehensive [documentation](https://mikemcl.github.io/big.js/) and test set\n- Uses only Dart, so works in well where Dart work\n\n\n## Use\n\n*In the code examples below, semicolons and `toString` calls are not shown.*\n\nThe library exports a some Extensions for `String`, `double`, `int`, `Big`.\n\nA Big number is created from a primitive `number`, `String`, or other `Big` number.\n\n```dart\nvar x = Big(123.4567)\nvar y = Big('123456.7e-3')\nvar z = Big(x)\nx.eq(y) \u0026\u0026 x.eq(z) \u0026\u0026 y.eq(z)          // true\n```\n\nIn Big strict mode, creating a Big number from a primitive number is disallowed.\n\n```dart\nBig.strict = true\nx = Big(1)                         // BigError(code: BigErrorCode.invalidNumber)\ny = Big('1.0000000000000001')\ny.toNumber()                       // BigError(code: BigErrorCode.impreciseConversion)\n```\n\nA Big number is immutable in the sense that it is not changed by its methods.\n\n```dart\n0.3 - 0.1                              // 0.19999999999999998\nx = Big(0.3)\nx.sub(0.1)                             // \"0.2\"\nx-0.1                                  // Big(0.2)\nx                                      // \"0.3\"\n```\n\nThe methods that return a Big number can be chained.\n\n```dart\nx.div(y).add(z).times(9).sub('1.234567801234567e+8').add(976.54321).div('2598.11772')\nx.sqrt().div(y).pow(3).gt(y.mod(z))    // true\n```\n\nLike JavaScript's Number type, there are `toStringAsExponential`, `toStringAsFixed` and `toStringAsPrecision` methods.\n\n```dart\nx = Big(255.5)\nx.toStringAsExponential(5)                     // \"2.55500e+2\"\nx.toStringAsFixed(5)                           // \"255.50000\"\nx.toStringAsPrecision(5)                       // \"255.50\"\n```\n\nThe arithmetic methods always return the exact result except `div`, `sqrt` and `pow`\n(with negative exponent), as these methods involve division.\n\nThe maximum number of decimal places and the rounding mode used to round the results of these methods is determined by the value of the `dp` and `rm` properties of the `Big` number constructor.\n\n```dart\nBig.dp = 10\nBig.rm = RoundingMode.roundHalfUp\nx = Big(2);\ny = Big(3);\nz = x.div(y)                           // \"0.6666666667\"\nz.sqrt()                               // \"0.8164965809\"\nz.pow(-3)                              // \"3.3749999995\"\nz.times(z)                             // \"0.44444444448888888889\"\nz.times(z).round(10)                   // \"0.4444444445\"\n```\n\nThe value of a Big number is stored in a decimal floating point format in terms of a coefficient, exponent and sign.\n\n```dart\nx = Big(-123.456);\nx.c                                    // [1,2,3,4,5,6]    coefficient (i.e. significand)\nx.e                                    // 2                exponent\nx.s                                    // -1               sign\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserdimoa%2Fbig.dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserdimoa%2Fbig.dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserdimoa%2Fbig.dart/lists"}