chenchhuanbao 34eb6c6369 first | 1 month ago | |
---|---|---|
.. | ||
lib | 1 month ago | |
README.md | 1 month ago | |
bignumber-vs-bigdecimal.html | 1 month ago | |
bigtime-OOM.js | 1 month ago | |
bigtime.js | 1 month ago |
This directory contains two command-line applications bigtime.js and bigtime-OOM.js, and for the browser bignumber-vs-bigdecimal.html, which enable some of the methods of bignumber.js to be tested against the JavaScript translations of the two versions of BigDecimal in the lib directory.
The BigDecimal in Node's npm registry is the GWT version. It has some bugs: see the Node script perf/lib/bigdecimal_GWT/bugs.js for examples of flaws in its remainder, divide and compareTo methods.
An example of using bigtime.js to compare the time taken by the bignumber.js plus
method and the GWT BigDecimal add
method:
$ node bigtime plus 10000 40
This will time 10000 calls to each, using operands of up to 40 random digits and will check that the results match.
For help:
$ node bigtime -h
bigtime-OOM.js works in the same way, but includes separate timings for object creation and method calls.
In general, bigtime.js is recommended over bigtime-OOM.js, which may run out of memory.
The usage of bignumber-vs-bigdecimal.html should be more or less self-explanatory.