{"name":"decimal.js-light","description":"An arbitrary-precision Decimal type for JavaScript.","version":"2.0.2","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","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.0.2 https://github.com/MikeMcl/decimal.js-light/LICENCE */\""},"gitHead":"260aa8b51914db17e56bdd83547622fa18b36d9f","bugs":{"url":"https://github.com/MikeMcl/decimal.js-light/issues"},"homepage":"https://github.com/MikeMcl/decimal.js-light#readme","_id":"decimal.js-light@2.0.2","_shasum":"4ce0d6ffc38cc530400072f9c82a9d1c800ea6b5","_from":".","_npmVersion":"3.8.1","_nodeVersion":"7.2.0","_npmUser":{"name":"mikemcl","email":"M8ch88l@gmail.com"},"dist":{"shasum":"4ce0d6ffc38cc530400072f9c82a9d1c800ea6b5","tarball":"http://registry-npm.ywwl.com/decimal.js-light/download/decimal.js-light-2.0.2.tgz","integrity":"sha512-5Gt1b5FY7NN/LNo6R+sJ/+f04flOYhqxJMxNIIxlOX9Cj6TTUWGjtOrjHCOhCQWvu55kqyBZ2BZGzVCojMbBnw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGBPkKxGmd4+1E1PBtDVISA1lnhfYWP0QMItkudWRO7wIgdwYRtr6Tzoa4RHZLKwZRv5PfJlu+o5lgeHFF6w1Wul0="}],"size":41836,"noattachment":false,"key":"/decimal.js-light/-/decimal.js-light-2.0.2.tgz"},"maintainers":[{"name":"mikemcl","email":"M8ch88l@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/decimal.js-light-2.0.2.tgz_1481549887771_0.9016948877833784"},"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":1481549890015,"_cnpm_publish_time":1481549890015,"dist-tags":{"latest":"2.5.1"}}