Skip to main content
Log in

Mojo function

sign

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

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

Parameters:

  • type (DType): DType used for the computation.
  • simd_width (Int): SIMD width used for the computation.

Args:

  • x (SIMD[type, simd_width]): The value to compute the sign operation on.

Returns:

The result of the sign operation.