Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
round vs trunc vs floor (2)
(version: 1)
Comparing performance of:
trunc vs round vs floor
Created:
one year ago
by:
Guest
Go to the latest result
Tests:
trunc
Math.trunc(13.37123123 * 1_000_000) / 1_000_000 Math.trunc(13.67123123 * 1_000_000) / 1_000_000
round
Math.round(13.37123123, 6) Math.round(13.67123123, 6)
floor
Math.floor(13.37123123, 6) Math.floor(13.67123123, 6)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
trunc
round
floor
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser/OS:
Chrome 133 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
round
258.7M/s
floor
243.3M/s
trunc
241.1M/s
View exact numbers
Test name
Executions per second
✓
round
258,677,504 Ops/sec
floor
243,322,448 Ops/sec
trunc
241,060,112 Ops/sec
Related benchmarks
round vs trunc vs floor
round vs trunc vs floor vs parseFloat
* 10, round vs trunc vs floor vs parseFloat vs ~~ vs 0 | vs parseInt vs parseInt, 10
* 10, round vs trunc vs floor vs parseFloat vs ~~ vs 0 | vs parseInt vs parseInt, 10 loop
Comments
Confirm delete:
Do you really want to delete benchmark?