Skip to main content
Log in

Mojo function

lt

lt(a: IntTuple[origin], b: IntTuple[origin]) -> Bool

Compare two IntTuples lexicographically.

This function performs element-wise comparison of two IntTuples and determines if the first is lexicographically less than the second. It compares corresponding elements until it finds a pair where the elements differ.

Example:

```mojo
from layout.int_tuple import lt, IntTuple

var tuple1 = IntTuple(1, 2, 3)
var tuple2 = IntTuple(1, 2, 4)

var result = lt(tuple1, tuple2) # Returns True because 3 < 4
```
.
```mojo
from layout.int_tuple import lt, IntTuple

var tuple1 = IntTuple(1, 2, 3)
var tuple2 = IntTuple(1, 2, 4)

var result = lt(tuple1, tuple2) # Returns True because 3 < 4
```
.

Args:

  • a (IntTuple[origin]): The first IntTuple to compare.
  • b (IntTuple[origin]): The second IntTuple to compare.

Returns:

True if a is lexicographically less than b, False otherwise.