Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
invert a nunmber
(version: 1)
Comparing performance of:
1 over x vs x to the power of -1 vs Math.pow
Created:
9 months ago
by:
Guest
Go to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
function a(x){return 1/x} function b(x){return x**-1} let{pow}=Math
Tests:
1 over x
for(let i = 100; i--;)a(i)
x to the power of -1
for(let i = 100; i--;)b(i)
Math.pow
for(let i = 100; i--;)pow(i,-1)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
1 over x
x to the power of -1
Math.pow
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
9 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Browser/OS:
Chrome 141 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
1 over x
11.1M/s
x to the power of -1
10.9M/s
Math.pow
10.9M/s
View exact numbers
Test name
Executions per second
✓
1 over x
11,071,466 Ops/sec
x to the power of -1
10,941,977 Ops/sec
Math.pow
10,878,766 Ops/sec
Related benchmarks
Anon functions vs named functions
math pow N1000 vs multiply
function dec vs function expr
arguments destructure vs parameters
arguments vs rest
Comments
Confirm delete:
Do you really want to delete benchmark?