Skip to main content

function

abs

abs(x: Int) -> Int

Gets the absolute value of an integer.

Args:

  • x (Int): Value to take the absolute value of.

Returns:

The absolute value of x.

abs[type: DType, simd_width: Int](x: ComplexSIMD[type, simd_width]) -> SIMD[$0, $1]

Performs elementwise abs (norm) on each element of the complex value.

Parameters:

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

Args:

  • x (ComplexSIMD[type, simd_width]): The complex vector to perform absolute value on.

Returns:

The elementwise abs of x.

abs[type: DType, simd_width: Int](x: SIMD[type, simd_width]) -> SIMD[$0, $1]

Performs elementwise absolute value on the elements of a SIMD vector.

Parameters:

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

Args:

  • x (SIMD[type, simd_width]): SIMD vector to perform absolute value on.

Returns:

The elementwise absolute value of x.