Programming-Idioms

Implementation
JS

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Implementation edit is for fixing errors and enhancing with metadata.

Instead of changing the code of the snippet, consider creating another JS implementation.

Other implementations
math
h := hypot(x,y);
include Math
h = hypot(x, y)
import math
h = math.hypot(x, y)
h = hypot(x,y)
use Math::AnyNum qw(hypot);
my $h = hypot $x, $y;
$h = hypot($x, $y)

// before PHP 4.1
$h = sqrt($x*$x + $y*$y);
import :math
def sq(x) do
  x*x
end

def hypo(a,b) do
  sqrt(sq(a) + sq(b))
end
import "math"
h := math.Hypot(x, y)
fn hypot(x:f64, y:f64)-> f64 {
    let num = x.powi(2) + y.powi(2);
    num.powf(0.5)
}
hypo x y = sqrt $ x**2 + y**2
double hypo(double x, double y)
{
    return Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2));
}