Skip to content

Commit 718ec5a

Browse files
committed
v5.2.0
1 parent 27dac46 commit 718ec5a

File tree

8 files changed

+39
-31
lines changed

8 files changed

+39
-31
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#### 5.2.0
2+
3+
* 09/10/18
4+
* #63 Allow negative argument for `round`.
5+
* #107 `sqrt` of large number.
6+
17
#### 5.1.2
28

39
* 24/05/18

README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# big.js
2-
[![Backers on Open Collective](https://opencollective.com/bigjs/backers/badge.svg)](#backers)
3-
[![Sponsors on Open Collective](https://opencollective.com/bigjs/sponsors/badge.svg)](#sponsors)
42

53
**A small, fast JavaScript library for arbitrary-precision decimal arithmetic.**
64

@@ -17,27 +15,32 @@ The little sister to [bignumber.js](https://github.com/MikeMcl/bignumber.js/) an
1715
- No dependencies
1816
- Comprehensive [documentation](http://mikemcl.github.io/big.js/) and test set
1917

20-
## Install
21-
22-
[Node.js](http://nodejs.org) users can install from the [npm](https://www.npmjs.com/package/big.js) registry using
23-
24-
$ npm install --save big.js
25-
26-
## Use
18+
## Set up
2719

2820
The library is the single JavaScript file *big.js* (or *big.min.js*, which is *big.js* minified).
2921

30-
It can be loaded via a script tag in an HTML document for the browser
22+
Browser:
23+
24+
```html
25+
<script src='path/to/big.js'></script>
26+
```
3127

32-
<script src='./relative/path/to/big.js'></script>
28+
[Node.js](http://nodejs.org):
3329

34-
or as a CommonJS, Node.js or AMD module using `require`.
30+
```bash
31+
$ npm install big.js
32+
```
3533

36-
var Big = require('big.js');
34+
```javascript
35+
const Big = require('big.js');
36+
```
3737

38-
If using an ES6 transpiler, or Node.js with the [`--experimental-modules`](https://nodejs.org/api/esm.html) flag, try
38+
ES6 module (*big.mjs*):
3939

40-
import Big from 'big.js';
40+
```javascript
41+
import Big from 'big.js';
42+
```
43+
## Use
4144

4245
*In all examples below, `var`, semicolons and `toString` calls are not shown. If a commented-out value is in quotes it means `toString` has been called on the preceding expression.*
4346

@@ -69,7 +72,7 @@ Like JavaScript's Number type, there are `toExponential`, `toFixed` and `toPreci
6972
x.toPrecision(5) // "255.50"
7073

7174
The arithmetic methods always return the exact result except `div`, `sqrt` and `pow`
72-
(with negative exponent), as these are the methods which involve division.
75+
(with negative exponent), as these methods involve division.
7376

7477
The maximum number of decimal places and the rounding mode used to round the results of these methods is determined by the value of the `DP` and `RM` properties of the `Big` number constructor.
7578

@@ -115,14 +118,14 @@ For the browser, see *single-test.html* and *every-test.html* in the *test/brows
115118

116119
## Performance
117120

118-
The *perf* directory contains two old applications and a *lib* directory containing the BigDecimal libraries used by both.
121+
The *perf* directory contains two legacy applications and a *lib* directory containing the BigDecimal libraries used by both.
119122

120123
*big-vs-bigdecimal.html* tests the performance of big.js against the JavaScript translations of two versions of BigDecimal, its use should be more or less self-explanatory.
121124

122125
* [GWT: java.math.BigDecimal](https://github.com/iriscouch/bigdecimal.js)
123126
* [ICU4J: com.ibm.icu.math.BigDecimal](https://github.com/dtrebbien/BigDecimal.js)
124127

125-
The BigDecimal in the npm registry is the GWT version. Despite its seeming popularity I have found it to have some serious bugs, see the Node.js script *perf/lib/bigdecimal_GWT/bugs.js* for examples of flaws in its *remainder*, *divide* and *compareTo* methods.
128+
The BigDecimal in the npm registry is the GWT version. It has some bugs, see the Node.js script *perf/lib/bigdecimal_GWT/bugs.js* for examples of flaws in its *remainder*, *divide* and *compareTo* methods.
126129

127130
*bigtime.js* is a Node.js command-line application which tests the performance of big.js against the GWT version of
128131
BigDecimal from the npm registry.
@@ -153,7 +156,7 @@ will create *big.min.js*.
153156

154157
The [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped) project has a Typescript type definitions file for big.js.
155158

156-
$ npm install --save @types/big.js
159+
$ npm install @types/big.js
157160

158161
Any questions about the TypeScript type definitions file should be addressed to the DefinitelyTyped project.
159162

big.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* big.js v5.1.2
2+
* big.js v5.2.0
33
* A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
4-
* Copyright (c) 2017 Michael Mclaughlin <M8ch88l@gmail.com>
4+
* Copyright (c) 2018 Michael Mclaughlin <M8ch88l@gmail.com>
55
* https://github.com/MikeMcl/big.js/LICENCE
66
*/
77
;(function (GLOBAL) {
@@ -107,7 +107,7 @@
107107
Big.RM = RM;
108108
Big.NE = NE;
109109
Big.PE = PE;
110-
Big.version = '5.1.2';
110+
Big.version = '5.2.0';
111111

112112
return Big;
113113
}

big.min.js

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)