Skip to main content

Mojo function

sign

sign[dtype: DType, simd_width: Int](x: SIMD[dtype, simd_width]) -> SIMD[dtype, simd_width]

Compute the sign (0, 1) of the input value.

Parameters:

  • โ€‹dtype (DType): DType used for the computation.
  • โ€‹simd_width (Int): SIMD width used for the computation.

Args:

Returns:

SIMD[dtype, simd_width]: The result of the sign operation.