{"name":"decimal.js-light","description":"An arbitrary-precision Decimal type for JavaScript.","version":"2.3.0","keywords":["arbitrary","precision","arithmetic","big","number","decimal","float","biginteger","bigdecimal","bignumber","bigint","bignum"],"repository":{"type":"git","url":"git+https://github.com/MikeMcl/decimal.js-light.git"},"main":"decimal.js","types":"decimal.d.ts","author":{"name":"Michael Mclaughlin","email":"M8ch88l@gmail.com"},"license":"MIT","scripts":{"test":"node ./test/test.js","build":"uglifyjs decimal.js --source-map doc/decimal.js.map -c -m -o decimal.min.js --preamble \"/* decimal.js-light v2.3.0 https://github.com/MikeMcl/decimal.js-light/LICENCE */\""},"gitHead":"7349bff9805364b62cb92111d85d58cd43059dc9","bugs":{"url":"https://github.com/MikeMcl/decimal.js-light/issues"},"homepage":"https://github.com/MikeMcl/decimal.js-light#readme","_id":"decimal.js-light@2.3.0","_npmVersion":"5.0.4","_nodeVersion":"8.5.0","_npmUser":{"name":"mikemcl","email":"M8ch88l@gmail.com"},"dist":{"integrity":"sha512-mdEjjuECdV5q3v4le7S23pGXv+WEYIwYN3t+3bs++WJqcCcWvFIFMJ3B+aIxVFZnJLM/RUASIeKT0VhD0h1f8g==","shasum":"ffc39c9f4ccc031afb6da0bb2eeecc440239e777","tarball":"http://registry-npm.ywwl.com/decimal.js-light/download/decimal.js-light-2.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0JfJfKDpbcTmGLGvYiks6LIVwCx6NMAwdvgtEwbC9NQIgKWG28iWKBj17GXF6gHZ4N2bT//WVC+o+U6rtDDQ3DJY="}],"size":56395,"noattachment":false,"key":"/decimal.js-light/-/decimal.js-light-2.3.0.tgz"},"maintainers":[{"name":"mikemcl","email":"M8ch88l@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/decimal.js-light-2.3.0.tgz_1506461910987_0.31596876471303403"},"directories":{},"readme":"![decimal.js-light](https://raw.githubusercontent.com/MikeMcl/decimal.js-light/gh-pages/decimaljslight.png)\r\n\r\nThe light version of [decimal.js](https://github.com/MikeMcl/decimal.js/), an arbitrary-precision Decimal type for JavaScript.\r\n\r\n[![Build Status](https://travis-ci.org/MikeMcl/decimal.js-light.svg)](https://travis-ci.org/MikeMcl/decimal.js-light)\r\n\r\n<br />\r\n\r\nThis library is the newest of the family of libraries: [bignumber.js](https://github.com/MikeMcl/bignumber.js/), [big.js](https://github.com/MikeMcl/big.js/), [decimal.js](https://github.com/MikeMcl/decimal.js/) and *decimal.js-light*.<br>\r\nThe API is more or less a subset of the API of *decimal.js*.\r\n\r\n![API](https://raw.githubusercontent.com/MikeMcl/decimal.js-light/gh-pages/API.png)\r\n\r\n__Differences between this library and *decimal.js*__\r\n\r\nSize of *decimal.js* minified: 32.1 KB.<br>\r\nSize of *decimal.js-light* minified: 12.7 KB.\r\n\r\nThis library does not include `NaN`, `Infinity` or `-0` as legitimate values, or work with values in other bases.\r\n\r\nHere, the `Decimal.round` property is just the default rounding mode for `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`. It does not apply to arithmetic operations, which are simply truncated at the required precision.\r\n\r\nIf rounding is required just apply it explicitly, for example\r\n\r\n```js\r\nx = new Decimal(2);\r\ny = new Decimal(3);\r\n\r\n// decimal.js\r\nx.dividedBy(y).toString();                       // '0.66666666666666666667'\r\n\r\n// decimal.js-light\r\nx.dividedBy(y).toString();                       // '0.66666666666666666666'\r\nx.dividedBy(y).toDecimalPlaces(19).toString();   // '0.6666666666666666667'\r\n```\r\n\r\nThe `naturalExponential`, `naturalLogarithm`, `logarithm`, and `toPower` methods in this library have by default a limited precision of around 100 digits. This limit can be increased at runtime using the `LN10` (the natural logarithm of ten) configuration object property.\r\n\r\nFor example, if a maximum precision of 400 digits is required for these operations use\r\n\r\n```js\r\n// 415 digits\r\nDecimal.set({\r\n  LN10: '2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286248633409525465082806756666287369098781689482907208325554680843799894826233198528393505308965377732628846163366222287698219886746543667474404243274365155048934314939391479619404400222105101714174800368808401264708068556774321622835522011480466371565912137345074785694768346361679210180644507064800027'\r\n});\r\n```\r\n\r\nAlso, in this library the `e` property of a Decimal is the base 10000000 exponent, not the base 10 exponent as in *decimal.js*.<br>\r\nUse the `exponent` method to get the base 10 exponent.\r\n\r\n## Quickstart\r\n\r\nBrowser:\r\n\r\n```html\r\n<script src='path/to/decimal.js-light'></script>\r\n```\r\n\r\nNode package manager:\r\n\r\n```shell\r\n$ npm install --save decimal.js-light\r\n```\r\n\r\n```js\r\n// Node.js\r\nvar Decimal = require('decimal.js-light');\r\n\r\n// Adjust the global configuration if required (these are the defaults)\r\nDecimal.set({\r\n  precision: 20,\r\n  rounding: Decimal.ROUND_HALF_UP,\r\n  toExpNeg: -7,\r\n  toExpPos: 21\r\n});\r\n\r\nphi = new Decimal('1.61803398874989484820458683436563811772030917980576');\r\n\r\nphi.toFixed(10);    // '1.6180339887'\r\n\r\nphi.times(2).minus(1).toPower(2).plus('1e-19').equals(5);    // true\r\n\r\n```\r\n\r\nSee the [documentation](http://mikemcl.github.io/decimal.js-light) for further information.\r\n\r\n[TypeScript](https://github.com/Microsoft/TypeScript) type declaration file contributed by [TANAKA Koichi](https://github.com/MugeSo).\r\n\r\n\r\n\r\n\r\n\r\n","publish_time":1506461912158,"_cnpm_publish_time":1506461912158,"dist-tags":{"latest":"2.5.1"}}