Mojo function
lt
lt(a: IntTuple[origin], b: IntTuple[origin]) -> Bool
Compare two IntTuple
s lexicographically.
This function performs element-wise comparison of two IntTuple
s 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 firstIntTuple
to compare. - b (
IntTuple[origin]
): The secondIntTuple
to compare.
Returns:
True if a
is lexicographically less than b
, False otherwise.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!