Skip to main content

Mojo function

abs

abs(t: IntTuple[origin]) -> IntTuple

Compute the absolute value of each element in an IntTuple.

This function applies the absolute value operation to each integer in a potentially nested IntTuple structure.

Args:

  • t (IntTuple): The IntTuple to transform.

Returns:

IntTuple: A new IntTuple with the same structure but with absolute values.

Was this page helpful?