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:
6 months ago
by:
Guest
Jump 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:
6 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
Test name
Executions per second
1 over x
11071466.0 Ops/sec
x to the power of -1
10941977.0 Ops/sec
Math.pow
10878766.0 Ops/sec
Related benchmarks:
Sqare Root
test power
New function 3
Anon functions vs named functions
Arrow function vs normal function comparison repeat
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?