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
Jump 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
Test name
Executions per second
trunc
241060112.0 Ops/sec
round
258677504.0 Ops/sec
floor
243322448.0 Ops/sec
Related benchmarks:
Floor Min
round vs trunc vs floor
round vs trunc vs floor vs parseFloat
Truncating a number to an integer
round vs add half and floor
Math.round
round vs trunc vs floor vs parseInt
* 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?