Skip to content

Logical operators

Equal to

function main()

    var x = 12;
    var y = 12;

    if (x == y)
        printLn("Equal.");
    endif

endfunction

Not equal to

function main()

    var x = 12;
    var y = 11;

    if (x != y)
        printLn("Not equal.");
    endif

endfunction

Less than

function main()

    var x = 12;
    var y = 11;

    if (y < x)
        printLn("Less than.");
    endif

    if (y <= x)
        printLn("Less than or equal to.");
    endif

endfunction

More than

function main()

    var x = 12;
    var y = 11;

    if (x > y)
        printLn("More than.");
    endif

    if (x >= y)
        printLn("More than or equal to.");
    endif

endfunction

And

function main()

    var f : Bool = false;
    var t : Bool = true;

    if (f && t)
        printLn("True.");
    else
        printLn("False.");
    endif

endfunction

Or

function main()

    var f : Bool = false;
    var t : Bool = true;

    if (f || t)
        printLn("True.");
    else
        printLn("False.");
    endif

endfunction

Xor

Note

Coming soon: support for xor.