{"name":"decimal.js-light","description":"An arbitrary-precision Decimal type for JavaScript.","version":"2.4.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","module":"decimal.mjs","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.4.0 https://github.com/MikeMcl/decimal.js-light/LICENCE */\""},"gitHead":"439fe53b39ddd8d9c8c7c29eaebeeda28ca90e0b","bugs":{"url":"https://github.com/MikeMcl/decimal.js-light/issues"},"homepage":"https://github.com/MikeMcl/decimal.js-light#readme","_id":"decimal.js-light@2.4.0","_npmVersion":"5.0.4","_nodeVersion":"10.0.0","_npmUser":{"name":"mikemcl","email":"M8ch88l@gmail.com"},"dist":{"integrity":"sha512-2HJa6ruFl/M+lshUMVfSTtnR8FVLheWS0wLoh1qJXErviyl8rkjxyGzzf2RDKYFWXkn1Vh9MnpMjA1ArhiKnTw==","shasum":"d0b5edf9c48e1afefecf901f17847b19aa1e30c3","tarball":"http://registry-npm.ywwl.com/decimal.js-light/download/decimal.js-light-2.4.0.tgz","fileCount":10,"unpackedSize":217883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbA/xfCRA9TVsSAnZWagAAS00P/0nTMaU7o+/a7DeR1JpL\nrDvBp3y7bZp43oDgFSKTTI3vKl6bxY/MqkPTsx2yvTSDFBIPj567FOEY/3lb\nQK9iUEkzh9+q/edkVwqE+CRGBvXoxbvAtFvJn7YNwD6+VqnbZFxhZjbCK2oQ\nYYUEllrVt4w1/CAi3hu0b3eaQ/my7FVcNMLqfVXHCY26lu/GAO4Tk+RCbNse\nPDAX+ZangKy/8h9pmr6yTZD3zD6wl+av7PwjMEP6j6ksIxq4nh27T0w9IBZ0\n+T8s6pYjGNXnMNxD6NwT7ulbFhihAuzTsDWxX6R3PwpbRmVIPD5MXgp6bEMi\nfCmHmUW/XCjJl7WFCUTdVH1SiC3sxcIkwPbP6gbV7kyNzlu9Xtwz2tnj/vfY\ncIo+GCfz5iepwxrRoU2hvGyc12YVvyS1sZkQFWqu04VNXwC2Yb3HR+/A9jjh\n6ktbG58240Irg7P4QRcUMqteOVthviUKhRFe5lPE80fJDItJ8REF5izp0SVy\nErhCg4nAW2r19NaEsKkPMatvwnDFJ6IZu9rkTFlP2BkC4H5tvA5aW17ZhkbJ\n6MkDgVVevH+ySJNPS2ndrtePltbpx3+uyt0GfAoAGB6cgJn/WpGNG7S+llnn\nwOM8ufH+GOdzuxvH3v1YjYcqIAhIzbSk8b0HaNKQ3hRtBJGS5C/1x7IXWBtg\n4Z63\r\n=VF6K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDvAEQY2tucjZWI4wE8Kf2x+7we135/ohzjTcOUxFTX+AiEA8uYmWbrodx60/c0MZ3z2vTvYjb95GpuGacIG+Tzjroc="}],"size":56703,"noattachment":false,"key":"/decimal.js-light/-/decimal.js-light-2.4.0.tgz"},"maintainers":[{"name":"mikemcl","email":"M8ch88l@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/decimal.js-light_2.4.0_1526987870067_0.565666138704092"},"_hasShrinkwrap":false,"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":1526987870171,"_cnpm_publish_time":1526987870171,"dist-tags":{"latest":"2.5.1"}}