English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The following are the logical operators available in Erlang.
Operator | Description | Example |
---|---|---|
or | Logical 'or' operator | True or true results in true |
and | Logical 'and' operator | True and false results in false |
not | Logical 'not' operator | Not false results in true |
xor | Logical 'xor' operator | True xor false results in false |
The following code snippet shows how to use various operators.
-module(helloworld). -export([start/0]). start() -> io:fwrite("~w~n",[true or false]), io:fwrite("~w~n",[true and false]), io:fwrite("~w~n",[true xor false]), io:fwrite("~w~n",[not false]).
The output of the above program will be:
true false true true