math.hypot() function
math.hypot()
returns the square root of p*p + q*q
, taking care to avoid overflow
and underflow.
Function type signature
(p: float, q: float) => float
Parameters
p
(Required) p-value to use in the operation.
q
(Required) q-value to use in the operation.
Examples
Return the hypotenuse of two values
import "math"
math.hypot(p: 2.0, q: 5.0)// 5.385164807134505
Use math.hypot in map
import "math"
data
|> map(fn: (r) => ({r with _value: math.hypot(p: r.a, q: r.b)}))
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.