# Value LessThanOrEqual

rascal-0.34.0

#### Synopsis

Less than or equal operator on values.

#### Syntax

`Exp₁ <= Exp₂`

#### Types

`Exp₁` | `Exp₂` | `Exp₁ <= Exp₂` |
---|---|---|

`value` | `value` | `bool` |

#### Description

By brute force, a total less than operator between two values *V*₁ and *V*₂ of arbitrary types *T*₁ and *T*₂ is defined:

If the types

*T₁*and*T₂*can be compared then*V₁*less than*V₂*is used.Otherwise values are ordered according their type name, for instance,

`int`

is smaller than`list`

, and`map`

is smaller than`rel`

.

Less than or equal yields `true`

if the value of *Exp*₁ is strictly less
than (according to the ordering defined above) the value of *Exp*₂ or if both values are equal, and `false`

otherwise.

#### Examples

Introduce two variables `X`

, `Y`

and `Z`

and force them to be of type `value`

:

`rascal>value X = "abc";`

value: "abc"

rascal>value Y = "def";

value: "def"

rascal>value Z = 3.14;

value: 3.14

Now compare `X`

and `Y`

:

`rascal>X <= Y;`

bool: true

and `X`

and `Z`

:

`rascal>X <= Z;`

bool: false