Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
bignumber.js vs. big.js apr
(version: 0)
- https://github.com/MikeMcl/bignumber.js/tree/v9.0.0 - https://github.com/MikeMcl/big.js/tree/v5.2.2 - https://github.com/MikeMcl/decimal.js/tree/v10.2.0
Comparing performance of:
Native vs Native + toFixed vs big.js vs bignumber.js
Created:
4 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/bignumber.js/9.0.1/bignumber.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/big.js/6.0.3/big.min.js"></script>
Tests:
Native
const val = 1 / ( 500724 * ( 1000002/3000000*0.93 ) * 100 ).toString(); console.log(val);
Native + toFixed
const val = 1 / ( 500724 * ( 1000002/3000000*0.93 ) * 100 ).toFixed(2); console.log(val);
big.js
const one = new Big(1); const totalStake = new Big(500724); const block = new Big(1000002).div(30000000).mul(0.93); const val = one.div((totalStake).mul(block).mul(31536000)).mul(100).toFixed(2); console.log(val);
bignumber.js
const one = new BigNumber(1); const totalStake = new BigNumber(500724); const block = new BigNumber(1000002).div(30000000).times(0.93); const val = one.div((totalStake).times(block).times(31536000)).times(100).toFormat(2); console.log(val);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
Native
Native + toFixed
big.js
bignumber.js
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
bignumber.js vs. big.js vs. decimal.js (I) no native
bignumber.js vs. big.js vs. decimal.js (without native)
number / bignumber.js / big.js / decimal.js
bignumber.js vs. big.js vs. decimal.js in 2024-05-03
bignumber.js vs. big.js vs. decimal.js@10.4.3 (I)
Comments
Confirm delete:
Do you really want to delete benchmark?