Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Math.sqrt(x * x) vs Math.sqrt(x ** 2)
(version: 1)
Math.sqrt(x * x) vs Math.sqrt(x ** 2)
Comparing performance of:
Math.sqrt(x * x) vs Math.sqrt(x ** 2)
Created:
2 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
const x = 123.456; const y = 789.123;
Tests:
Math.sqrt(x * x)
Math.sqrt(x * x + y * y); const z = Math.random() Math.sqrt(z * z);
Math.sqrt(x ** 2)
Math.sqrt(x ** 2 + y ** 2); const z = Math.random() Math.sqrt(z ** 2);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Math.sqrt(x * x)
Math.sqrt(x ** 2)
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36 Edg/148.0.0.0
Browser/OS:
Chrome 148 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Math.sqrt(x * x)
49646084.0 Ops/sec
Math.sqrt(x ** 2)
49592280.0 Ops/sec
Comments
Confirm delete:
Do you really want to delete benchmark?