← All built-ins / hypot()

hypot()

hypot(...$args): float

Parameters

NameTypeDescription
$xfloat|intfirst leg
$yfloat|intsecond leg

Return value

sqrt(x² + y²), overflow-safe.

Example

echo hypot(3, 4), " ", hypot(5, 12);
5 13

See also

sqrt()pow()