Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
test stefaf aasf13123
(version: 0)
Comparing performance of:
my vs BigNumber vs Native
Created:
4 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/bignumber.js@9.0.1/bignumber.min.js"></script>
Tests:
my
function plus(a, b) { let result = []; const aSplit = String(a).split("."); const bSplit = String(b).split("."); result[0] = [BigInt(aSplit[0]) + BigInt(bSplit[0])]; if(!aSplit[1]) { aSplit[1] = 0; } if(!bSplit[1]) { bSplit[1] = 0; } result[1] = [BigInt(aSplit[1]) + BigInt(bSplit[1])]; if(result[1] > 9) { result[0]++; result[1] = result[1] % 10; } return String(result.join('.')); } plus(0.1,0.3)
BigNumber
var a = new BigNumber("0.1"); var b = new BigNumber("0.2"); a.plus(b).toString();
Native
var a = 0.1; var b = 0.2; ((a + b) * b).toString();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
my
BigNumber
Native
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 (no to string)
validate bignumber.js shiftedBy
validate bignumber.js big.js shiftedBy
bignumber.js vs. big.js vs. decimal.js (I)asd
bigint vs. bignumber.js vs. big.js vs. break_infinity.js
Comments
Confirm delete:
Do you really want to delete benchmark?