Skip to main content
Log in

Mojo function

sqrt

sqrt(x: Int) -> Int

Performs square root on an integer.

Args:

  • x (Int): The integer value to perform square root on.

Returns:

The square root of x.

sqrt[dtype: DType, width: Int, //](x: SIMD[dtype, width]) -> SIMD[dtype, width]

Performs elementwise square root on the elements of a SIMD vector.

Parameters:

  • dtype (DType): The dtype of the input and output SIMD vector.
  • width (Int): The width of the input and output SIMD vector.

Args:

  • x (SIMD[dtype, width]): SIMD vector to perform square root on.

Returns:

The elementwise square root of x.