{"id":28666348,"url":"https://github.com/boulangerie/lodash-arithmetic","last_synced_at":"2025-10-27T15:43:22.821Z","repository":{"id":82423941,"uuid":"76805511","full_name":"Boulangerie/lodash-arithmetic","owner":"Boulangerie","description":"Lodash mixins for arbitrary-precision arithmetic","archived":false,"fork":false,"pushed_at":"2016-12-18T21:45:05.000Z","size":5,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-16T18:45:23.902Z","etag":null,"topics":["arbitrary","arithmetic","big","decimal","float","lodash","maths","mixins","number","operations","precision"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Boulangerie.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-18T20:38:48.000Z","updated_at":"2023-12-05T06:34:09.000Z","dependencies_parsed_at":"2023-07-18T14:16:15.404Z","dependency_job_id":null,"html_url":"https://github.com/Boulangerie/lodash-arithmetic","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"109b3080fc46e72df5633422e08d4143e41ddfb1"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Boulangerie/lodash-arithmetic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boulangerie%2Flodash-arithmetic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boulangerie%2Flodash-arithmetic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boulangerie%2Flodash-arithmetic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boulangerie%2Flodash-arithmetic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Boulangerie","download_url":"https://codeload.github.com/Boulangerie/lodash-arithmetic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Boulangerie%2Flodash-arithmetic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267951330,"owners_count":24171015,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"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","arithmetic","big","decimal","float","lodash","maths","mixins","number","operations","precision"],"created_at":"2025-06-13T14:14:34.192Z","updated_at":"2025-10-27T15:43:17.785Z","avatar_url":"https://github.com/Boulangerie.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lodash-arithmetic\n[![Build Status](https://img.shields.io/travis/Boulangerie/lodash-arithmetic.svg?style=flat-square)](https://travis-ci.org/Boulangerie/lodash-arithmetic)\n[![Coveralls](https://img.shields.io/coveralls/Boulangerie/lodash-arithmetic.svg?branch=master)](https://coveralls.io/github/Boulangerie/lodash-arithmetic)\n[![npm version](https://img.shields.io/npm/v/lodash-arithmetic.svg?style=flat-square)](https://www.npmjs.org/package/lodash-arithmetic)\n[![npm downloads](https://img.shields.io/npm/dm/lodash-arithmetic.svg?style=flat-square)](http://npm-stat.com/charts.html?package=lodash-arithmetic\u0026from=2016-12-18)\n[![npm dependencies](https://img.shields.io/david/Boulangerie/lodash-arithmetic.svg)](https://david-dm.org/Boulangerie/lodash-arithmetic)\n[![npm devDependencies](https://img.shields.io/david/dev/Boulangerie/lodash-arithmetic.svg)](https://david-dm.org/Boulangerie/lodash-arithmetic)\n[![npm license](https://img.shields.io/npm/l/lodash-arithmetic.svg)](https://www.npmjs.org/package/lodash-arithmetic)\n\n\u003e Lodash mixins for arbitrary-precision arithmetic\n\n## Why Lo-Dash mixins for arithmetic?\nBecause of binary floating-point, arithmetic operations in JavaScript may imply rounding issues like:\n\u003e 0.1 + 0.2 = 0.30000000000000004\n\nYou will find a complete explanation about floating-point arithmetic at http://floating-point-gui.de/.\n\nLodash-arithmetic provides simple Lo-Dash mixins for basic arithmetic operations: addition, subtraction, multiplication and division.\nEven if Lo-Dash 4 natively has the methods [_.add](https://lodash.com/docs/4.17.2#add), [_.subtract](https://lodash.com/docs/4.17.2#subtract), [_.multiply](https://lodash.com/docs/4.17.2#multiply) and [_.divide](https://lodash.com/docs/4.17.2#divide), they do not take in account arbitrary-precision decimal.\n\n**Let's see the following examples:**\n```js\n// Without Lo-Dash\nconsole.log(0.1 + 0.2 === 0.3) // false\n\n// With Lo-Dash 4 but without the arithmetic mixins\nconsole.log(_.add(0.1, 0.2) === 0.3) // false\n\n// With Lo-Dash and the arithmetic mixins\nconsole.log(_.add(0.1, 0.2) === 0.3) // true\n```\n\n## Install\nThe easiest way is to install `lodash-arithmetic` as `dependency`:\n```sh\nnpm install lodash-arithmetic --save\n```\n\n## Usage\n##### Addition\n```js\n_.add(0.1, 0.2); // 0.3\n```\n##### Subtraction\n```js\n_.subtract(0.1235, 0.1234); // 0.0001\n```\n##### Multiplication\n```js\n_.multiply(0.07, 100); // 7\n```\n##### Division\n```js\n_.divide(8.2, 1000); // 0.0082\n```\n##### Chaining\n```js\n_(0.1)\n  .add(0.2)\n  .multiply(77.1)\n  .subtract(0.12345)\n  .value(); // 23.00655\n```\n\n## License\nCode licensed under [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboulangerie%2Flodash-arithmetic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboulangerie%2Flodash-arithmetic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboulangerie%2Flodash-arithmetic/lists"}