Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Number round
(version: 0)
Comparing performance of:
Math.floor(a) vs ~~ vs ^0 vs parseInt vs toFixed
Created:
5 years ago
by:
Registered User
Jump to the latest result
Script Preparation code:
var a = 13.3432432534
Tests:
Math.floor(a)
Math.floor(a)
~~
~~a
^0
a^0
parseInt
parseInt(a)
toFixed
+a.toFixed()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (5)
Previous results
Fork
Test case name
Result
Math.floor(a)
~~
^0
parseInt
toFixed
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:
Round Numbers to 2 digits
Floating Point ToFixed
toFixed vs toPrecision vs Math.round() vs Math.floorfast vs MDN round_to_precision
Decimal rounding
toFixed vs mathjs round
Comments
Confirm delete:
Do you really want to delete benchmark?