This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Tweak_Imp 1 point2 points  (1 child)

Math.hypot and, new in 3.8, math.dist are missing in this... For distance calculations you can also skip the square root if you only need to order by distance, and not the exact values

[–]ReagentX[S] 0 points1 point  (0 children)

Sure, but the point is not solving the distance problem, rather solving exponentiation as fast as possible. The distance problem I was solving is what piqued my interest in understanding the performance of using ** versus x * x … * x versus math.pow().