SIMPOL Documentation

Comparison Operators

Comparison operators are used for doing comparisons for the purpose of flow-control within the language. They differ from arithmetic operators in that they typically only return .true or .false which is then used to make a decision about the flow of the program.

Less than (<)

Operand count

2

Types

.nul, .inf, boolean, integer, number, string

Description

The result is .true if the first operand is less than the second operand, otherwise it is .false. Values of any types can be compared. Values are considered to be in the following order, with the greatest first. Within any item below values are compared in the normal way.

  • .inf

  • numbers greater than or equal to 1

  • .true

  • strings that are not empty

  • blobs that are not empty

  • numbers greater than 0 and less than 1

  • the empty blob

  • the empty string

  • .false

  • zero

  • negative numbers

  • .nul

Less than or equal (<=)

Operand count

2

Types

.nul, .inf, boolean, integer, number, string

Description

The result is .true if the first operand is less than or equal to the second operand, otherwise it is .false. Values of any types can be compared. Values are considered to be in the following order, with the greatest first. Within any item below values are compared in the normal way.

  • .inf

  • numbers greater than or equal to 1

  • .true

  • strings that are not empty

  • blobs that are not empty

  • numbers greater than 0 and less than 1

  • the empty blob

  • the empty string

  • .false

  • zero

  • negative numbers

  • .nul

Equal to (==)

Operand count

2

Types

.nul, .inf, boolean, integer, number, string

Description

The result is .true if the first operand is equal to the second operand, otherwise it is .false. Values of any types can be compared. Values are considered to be in the following order, with the greatest first. Within any item below values are compared in the normal way.

  • .inf

  • numbers greater than or equal to 1

  • .true

  • strings that are not empty

  • blobs that are not empty

  • numbers greater than 0 and less than 1

  • the empty blob

  • the empty string

  • .false

  • zero

  • negative numbers

  • .nul

Not equal to (<>, !=)

Operand count

2

Types

.nul, .inf, boolean, integer, number, string

Description

The result is .true if the first operand is not equal to the second operand, otherwise it is .false. Values of any types can be compared. Values are considered to be in the following order, with the greatest first. Within any item below values are compared in the normal way.

  • .inf

  • numbers greater than or equal to 1

  • .true

  • strings that are not empty

  • blobs that are not empty

  • numbers greater than 0 and less than 1

  • the empty blob

  • the empty string

  • .false

  • zero

  • negative numbers

  • .nul

Greater than or equal (>=)

Operand count

2

Types

.nul, .inf, boolean, integer, number, string

Description

The result is .true if the first operand is greater than or equal to the second operand, otherwise it is .false. Values of any types can be compared. Values are considered to be in the following order, with the greatest first. Within any item below values are compared in the normal way.

  • .inf

  • numbers greater than or equal to 1

  • .true

  • strings that are not empty

  • blobs that are not empty

  • numbers greater than 0 and less than 1

  • the empty blob

  • the empty string

  • .false

  • zero

  • negative numbers

  • .nul

Greater than (>)

Operand count

2

Types

.nul, .inf, boolean, integer, number, string

Description

The result is .true if the first operand is greater than the second operand, otherwise it is .false. Values of any types can be compared. Values are considered to be in the following order, with the greatest first. Within any item below values are compared in the normal way.

  • .inf

  • numbers greater than or equal to 1

  • .true

  • strings that are not empty

  • blobs that are not empty

  • numbers greater than 0 and less than 1

  • the empty blob

  • the empty string

  • .false

  • zero

  • negative numbers

  • .nul

Refer to same object (=@=)

Operand count

2

Types

.nul, any object

Description

The result is .true if both operands are references to the same object or are both nul object references, otherwise it is .false.

Not refer to same object (<@>, !@=)

Operand count

2

Types

.nul, any object

Description

The result is .false if both operands are references to the same object or are both nul object references, otherwise it is .true.