On this page
  1. Math.hypot
  2. Signature & Overview
  3. Notes & Pitfalls
  4. Example

Math.hypot

Prev: random | Up: Math | Next: JSON
Rel: Math, JSON, Math, BigInt & Date Guide
Ref: MDN Web Docs — Math.hypot
Tags: #public #web #javascript #builtins #math #tier/standard


Signature & Overview

Math.hypot(...values)  /* + sqrt(), abs() */

Computes the square root of the sum of squares without intermediate overflow/underflow.

Notes & Pitfalls

Example

console.assert(Math.hypot(3, 4) === 5);
console.assert(Math.hypot(2, 3, 6) === 7);

Linked from

Related notes