Skip to content

lt

Syntax

lt(x1, x2)

Parameters

x1 : numeric-expression
left-hand argument.
x2 : numeric-expression
right-hand argument.

Returns

Returns 1 if x1 is less than x2, 0 otherwise.

Description

Numeric comparison equivalent to the infix form x1 < x2.

To use a numeric comparison operator within an expression, you must use the functional version of the operator. For example:

x = x + lt(age, 10)  # adds 1 to x if age < 10
x = x + (age < 10)  # will result in a fred_compiler error message.

Examples

Agents with an age less than 18 can be filtered into the state Select with the transition rule:

if (lt(age, 18)) then next(Select)

or with the infix form:

if (age<18) then next(Select)

See Also