Recent Changes - Search:

* PCAN

* Phix

edit SideBar

RelationalOperators

Index | Core Language | Expressions | Relational Operators

Relational Operators

The six relational operators  <   >   <=   >=   =   !=   each produce a true(1) or a false(0) result.

        8.8 < 8.7   -- 8.8 less than 8.7 (false)
        -4.4 > -4.3 -- -4.4 greater than -4.3 (false)
        8 <= 7   -- 8 less than or equal to 7 (false)
        4 >= 4   -- 4 greater than or equal to 4 (true)
        1 = 10      -- 1 equal to 10 (false)
        8.7 != 8.8  -- 8.7 not equal to 8.8 (true)
        {1,2,3} = {4,5,6} -- {1,2,3} equal to {4,5,6} (false)
        {7,8,9} = {7,8,9} -- {7,8,9} equal to {7,8,9} (true)

Note that the last two examples are incompatible with Euphoria, which produces the same results as the Phix-only sq_eq() builtin.

As we will soon see you can also apply function-style equivalents to entire sequences to yield nested lists of true/false, eg sq_lt({8.8,{8.7,8.6}},8.7) ==>; {false,{false,true}}.

< Expressions | Index | Logical Operators >

Edit - History - Print - Recent Changes - Search
Page last modified on April 16, 2026, at 03:13 PM