Flooring a float

Benchmark created on


Setup

let base = Math.PI * 10000000000;
let n;

Test runner

Ready to run.

Testing in
TestOps/sec
Math.floor()
while(base.toString().length > 1) {
	n = Math.floor(base);
	base = base / 10;
}
ready
bitwise >> 0
while(base.toString().length > 1) {
	n = base >> 0;
	base = base / 10;
}
ready
bitwise | 0
while(base.toString().length > 1) {
	n = base | 0;
	base = base / 10;
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.