Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Math.ceil vs floor vs ~~
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0
Browser:
Firefox 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
~~test
2448.7M/s
Math.floor(test)
2430.2M/s
Math.ceil(test)
2170.1M/s
Math.floor(test) + 1 (CEIL)
2019.1M/s
FAST CEIL
1557.0M/s
View exact numbers
Test name
Executions per second
✓
~~test
2,448,660,224 Ops/sec
Math.floor(test)
2,430,173,696 Ops/sec
Math.ceil(test)
2,170,142,464 Ops/sec
Math.floor(test) + 1 (CEIL)
2,019,061,376 Ops/sec
FAST CEIL
1,556,981,504 Ops/sec
Script Preparation code:
var test = 190.4;
Tests:
Math.ceil(test)
Math.ceil(test)
~~test
~~test
Math.floor(test)
Math.floor(test)
Math.floor(test) + 1 (CEIL)
Math.floor(test) + 1
FAST CEIL
~~test + 1