Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
decimal.js vs. Fraction.js
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 18
Operating system:
iOS 18.0
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
Native
574989376.0 Ops/sec
Native + toFixed
10362981.0 Ops/sec
decimal.js
1270028.5 Ops/sec
Fraction.js
1205593.5 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/decimal.js@10.2.0/decimal.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/fraction.js@4.0.12/fraction.min.js"></script>
Tests:
Native
var a = 0.1; var b = 0.2; ((a + b) * b).toString();
Native + toFixed
var a = 0.1; var b = 0.2; ((a + b) * b).toFixed(9);
decimal.js
var a = new Decimal("0.1"); var b = new Decimal("0.2"); a.plus(b).times(b).toString();
Fraction.js
var a = new Fraction("0.1"); var b = new Fraction("0.2"); a.add(b).mul(b).toString();