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:

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

Returns:

The result of the sign operation.

Was this page helpful?