sqrt

sqrt(x: array, /) array

Calculates the square root, having domain [0, +infinity] and codomain [0, +infinity], for each element x_i of the input array x. After rounding, each result must be indistinguishable from the infinitely precise result (as required by IEEE 754).

Special cases

For floating-point operands,

  • If x_i is NaN, the result is NaN.

  • If x_i is less than 0, the result is NaN.

  • If x_i is +0, the result is +0.

  • If x_i is -0, the result is -0.

  • If x_i is +infinity, the result is +infinity.

Parameters:

x (array) – input array. Should have a floating-point data type.

Returns:

out (array) – an array containing the square root of each element in x. The returned array must have a floating-point data type determined by Type Promotion Rules.