{
  "name": "bignumber.js",
  "description": "A library for arbitrary-precision decimal and non-decimal arithmetic",
  "version": "1.0.1",
  "keywords": [
    "arbitrary",
    "precision",
    "arithmetic",
    "big",
    "number",
    "decimal",
    "float",
    "biginteger",
    "bigdecimal",
    "bignumber",
    "bigint",
    "bignum"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/MikeMcl/bignumber.js.git"
  },
  "main": "bignumber",
  "author": {
    "name": "Michael Mclaughlin",
    "email": "M8ch88l@gmail.com"
  },
  "engines": {
    "node": "*"
  },
  "license": "MIT",
  "scripts": {
    "test": "node ./test/every-test.js",
    "build": "uglifyjs -o ./bignumber.min.js ./bignumber.js"
  },
  "readme": "\r\n# bignumber.js #\r\n\r\nA Javascript library for arbitrary-precision decimal and non-decimal arithmetic.  \r\n     \r\n## Features\r\n\r\n  - Faster, smaller, and perhaps easier to use than Javascript versions of Java's BigDecimal\r\n  - 5 KB minified and gzipped\r\n  - Simple API but full-featured\r\n  - Works with numbers with or without fraction digits in bases from 2 to 36 inclusive\r\n  - Replicates the `toExponential`, `toFixed`, `toPrecision` and `toString` methods of Javascript's Number type\r\n  - Includes a `toFraction` and a `squareRoot` method\r\n  - Stores values in an accessible decimal floating point format\r\n  - No dependencies\r\n  - Comprehensive documentation and test set \r\n\r\nIf an even smaller and simpler library is required see [big.js](https://github.com/MikeMcl/big.js/).   \r\nIt's half the size but only works with decimal numbers and only has half the methods.   \r\nIt also does not allow `NaN` or `Infinity`, or have the configuration options of this library. \r\n\r\n## Load\r\n\r\nThe library is the single Javascript file *bignumber.js*   \r\n(or *bignumber.min.js*, which is *bignumber.js* minified using uglify-js).   \r\n\r\nIt can be loaded via a script tag in an HTML document for the browser\r\n\r\n    <script src='./relative/path/to/bignumber.js'></script>\r\n   \r\nor as a CommonJS, [Node.js](http://nodejs.org) or AMD module using `require`. \r\n\r\nFor Node, put the *bignumber.js* file into the same directory as the file that is requiring it and use\r\n\r\n    var BigNumber = require('./bignumber'); \r\n\r\nor put it in a *node_modules* directory within the directory and use `require('bignumber')`. \r\n\r\nThe library is also available from the [npm](https://npmjs.org/) registry, so\r\n\r\n    $ npm install bignumber.js\r\n\r\nwill install this entire directory in a *node_modules* directory within the current directory.  \r\nIt can then be loaded with `require('bignumber.js')`. \r\n \r\nTo load with AMD loader libraries such as [requireJS](http://requirejs.org/):\r\n\r\n    require(['bignumber'], function(BigNumber) {  \r\n        // Use BigNumber here in local scope. No global BigNumber. \r\n    });\r\n\r\n## Use\r\n\r\n*In all examples below, `var`, semicolons and `toString` calls are not shown.    \r\nIf a commented-out value is in quotes it means `toString` has been called on the preceding expression.*\r\n\r\nThe library exports a single function: BigNumber, the constructor of BigNumber instances.    \r\nIt accepts a value of type Number, String or BigNumber Object,   \r\n\r\n    x = new BigNumber(123.4567)\r\n    y = BigNumber('123456.7e-3')                     // 'new' is optional\r\n    z = new BigNumber(x)\r\n    x.equals(y) && y.equals(z) && x.equals(z)        // true\r\n\r\nand a base from 2 to 36 inclusive can be specified.\r\n\r\n    x = new BigNumber(1011, 2)           // \"11\" \r\n    y = new BigNumber('zz.9', 36)        // \"1295.25\"\r\n    z = x.plus(y)                        // \"1306.25\"\r\n\r\nA BigNumber is immutable in the sense that it is not changed by its methods.  \r\n\r\n    0.3 - 0.1                     // 0.19999999999999998  \r\n    x = new BigNumber(0.3)            \r\n    x.minus(0.1)                  // \"0.2\"\r\n    x                             // \"0.3\"\r\n\r\nThe methods that return a BigNumber can be chained.\r\n\r\n    x.dividedBy(y).plus(z).times(9).floor()\r\n    x.times('1.23456780123456789e+9').plus(9876.5432321).dividedBy('4444562598.111772').ceil()\r\n\r\nMethod names over 5 letters in length have a shorter alias.\r\n\r\n    x.squareRoot().dividedBy(y).toPower(3).equals(x.sqrt().div(y).pow(3))         // true\r\n    x.cmp(y.mod(z).neg()) == 1 && x.comparedTo(y.modulo(z).negated()) == 1        // true\r\n\r\nLike Javascript's Number type, there are `toExponential`, `toFixed` and `toPrecision` methods\r\n\r\n    x = new BigNumber(255.5)        \r\n    x.toExponential(5)              // \"2.55500e+2\"\r\n    x.toFixed(5)                    // \"255.50000\"\r\n    x.toPrecision(5)                // \"255.50\"\r\n\r\n and a base can be specified for `toString`.\r\n\r\n    x.toString(16)        // \"ff.8\"\r\n\r\nThe maximum number of decimal places and the rounding mode for division, square root, base conversion, and negative power operations is set by a configuration object passed to the `config` method of the `BigNumber` constructor.       \r\nThe other arithmetic operations always give the exact result.\r\n\r\n    BigNumber.config({ DECIMAL_PLACES : 10, ROUNDING_MODE : 4 })\r\n    // Alternatively, BigNumber.config( 10, 4 );\r\n\r\n    x = new BigNumber(2);\r\n    y = new BigNumber(3);        \r\n    z = x.div(y)                 // \"0.6666666667\"\r\n    z.sqrt()                     // \"0.8164965809\"\r\n    z.pow(-3)                    // \"3.3749999995\"\r\n    z.toString(2)                // \"0.1010101011\"\r\n    z.times(z)                   // \"0.44444444448888888889\"\r\n    z.times(z).round(10)         // \"0.4444444445\"\r\n\r\nThere is a `toFraction` method with an optional *maximum denominator* argument\r\n\r\n    y = new BigNumber(355)\r\n    pi = y.dividedBy(113)        // \"3.1415929204\"\r\n    pi.toFraction()              // [ \"7853982301\", \"2500000000\" ]\r\n    pi.toFraction(1000)          // [ \"355\", \"113\" ]\r\n\r\nand `isNaN` and `isFinite` methods, as `NaN` and `Infinity` are valid `BigNumber` values.\r\n\r\n    x = new BigNumber(NaN)                                           // \"NaN\"\r\n    y = new BigNumber(Infinity)                                      // \"Infinity\"\r\n    x.isNaN() && !y.isNaN() && !x.isFinite() && !y.isFinite()        // true\r\n\r\nThe value of a BigNumber is stored in a decimal floating point format in terms of a coefficient, exponent and sign.\r\n\r\n    x = new BigNumber(-123.456); \r\n    x.c                                 // \"1,2,3,4,5,6\"    coefficient (i.e. significand)\r\n    x.e                                 // 2                exponent \r\n    x.s                                 // -1               sign\r\n\r\nFor futher information see the API reference in the *doc* folder.\r\n\r\n## Test\r\n\r\nThe *test* directory contains the test scripts for each method. \r\n\r\nThe tests can be run with Node or a browser.   \r\n\r\nFor a quick test of all the methods, from a command-line shell at the *test/* directory\r\n\r\n    $ node quick-test\r\n\r\nTo test a single method in more depth, e.g.\r\n\r\n    $ node toFraction\r\n\r\nTo test all the methods in more depth\r\n\r\n    $ node every-test\r\n\r\nFor the browser, see *quick-test.html*, *single-test.html* and *every-test.html* in the *test/browser* directory.  \r\n \r\n*bignumber-vs-number.html* enables some of the methods of bignumber.js to be compared with those of Javascript's Number type.  \r\n\r\n## Performance\r\n\r\nThe *perf* directory contains two applications and a *lib* directory containing the BigDecimal libraries used by both.   \r\n \r\n*bignumber-vs-bigdecimal.html* tests the performance of bignumber.js against the Javascript translations of two versions of BigDecimal, its use should be more or less self-explanatory.\r\n(The GWT version doesn't work in IE 6.)  \r\n\r\n* GWT: java.math.BigDecimal   \r\n<https://github.com/iriscouch/bigdecimal.js>\r\n* ICU4J: com.ibm.icu.math.BigDecimal    \r\n<https://github.com/dtrebbien/BigDecimal.js>     \r\n\r\nThe BigDecimal in Node's npm registry is the GWT version. Despite its seeming popularity I have found it to have some serious bugs, see the Node script *perf/lib/bigdecimal_GWT/bugs.js* for examples of flaws in its *remainder*, *divide* and *compareTo* methods.   \r\n\r\n*bigtime.js* is a Node command-line application which tests the performance of bignumber.js against the GWT version of BigDecimal from the npm registry.  \r\n\r\nFor example, to compare the time taken by the bignumber.js `plus` method and the BigDecimal `add` method:  \r\n    \r\n    $ node bigtime plus 10000 40      \r\n    \r\nThis will time 10000 calls to each, using operands of up to 40 random digits and will check that the results match.   \r\n   \r\nFor help:\r\n\r\n    $ node bigtime -h\r\n\r\nSee the README in the directory for more information.\r\n\r\n## Build\r\n\r\nI.e. minify.\r\n\r\nFor Node, if uglify-js is installed globally ( `npm install uglify-js -g` ) then \r\n\r\n    uglifyjs -o ./bignumber.min.js ./bignumber.js\r\n\r\nwill create *bignumber.min.js*.   \r\n\r\n## Feedback\r\n\r\nBugs: surely not! Open an issue, please.  \r\nOther feedback to:\r\n\r\nMichael Mclaughlin  \r\n<a href=\"mailto:M8ch88l@gmail.com\">M8ch88l@gmail.com</a>\r\n\r\nBitcoin donation to:  \r\n**1KdnpLRSkWJs4FXPzj7pQ39H4Ur6Urydti**  \r\nThank you\r\n\r\n## Licence\r\n\r\nSee LICENCE.\r\n\r\n## Change Log\r\n\r\n####1.0.1\r\n* Bugfix: error messages with incorrect method name \r\n* Corrected a couple of spelling mistakes in comments\r\n* Very minor regex tweaks\r\n\r\n####1.0.0\r\n* 8/11/2012 Initial release   \r\n\r\n[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/50b85fd919b406ef9312551092a95fb7 \"githalytics.com\")](http://githalytics.com/MikeMcl/bignumber.js)\r\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/MikeMcl/bignumber.js/issues"
  },
  "homepage": "https://github.com/MikeMcl/bignumber.js",
  "_id": "bignumber.js@1.0.1",
  "_from": "bignumber.js@1.0.1"
}
