math.hypot() function

The math.hypot() function returns the square root of p*p + q*q, taking care to avoid overflow and underflow.

*Output data type: Float*

  1. import "math"
  2. math.hypot(p: 2.0, q: 5.0)
  3. // Returns 5.385164807134505

Parameters

p

The p value used in the operation.

*Data type: Float*

q

The q value used in the operation.

*Data type: Float*

Special cases

  1. math.hypot(p: ±Inf, q:q) // Returns +Inf
  2. math.hypot(p:p, q: ±Inf) // Returns +Inf
  3. math.hypot(p: NaN, q:q) // Returns NaN
  4. math.hypot(p:p, q: NaN) // Returns NaN