docs-v2/content/v2.0/reference/flux/functions/math/sqrt.md

569 B

title description menu weight
math.sqrt() function The math.sqrt() function returns the square root of `x`.
v2_0_ref
name parent
math.sqrt Math
301

The math.sqrt() function returns the square root of x.

Output data type: Float

import "math"

math.sqrt(x: 4.0)

// Returns 2.0

Parameters

x

The value used in the operation.

Data type: Float

Special cases

math.sqrt(x: +Inf) // Returns +Inf
math.sqrt(x: ±0)   // Returns ±0
math.sqrt(x: <0)   // Returns NaN
math.sqrt(x: NaN)  // Returns NaN