Skip to main content

Mojo function

ulp

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

Computes the ULP (units of last place) or (units of least precision) of the number.

Constraints:

The element type of the inpiut must be a floating-point type.

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 input.

Returns:

The ULP of x.

Was this page helpful?