math.hypot() function

Flux 0.22.0+

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

Output data type: Float

import "math"

math.hypot(p: 2.0, q: 5.0)

// Returns 5.385164807134505



The p value used in the operation.


The q value used in the operation.

Special cases

math.hypot(p: ±Inf, q:q) // Returns +Inf
math.hypot(p:p, q: ±Inf) // Returns +Inf
math.hypot(p: NaN, q:q)  // Returns NaN
math.hypot(p:p, q: NaN)  // Returns NaN

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.