Skip to content

Instantly share code, notes, and snippets.

@hgarcia
Created March 19, 2012 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hgarcia/2094463 to your computer and use it in GitHub Desktop.
Save hgarcia/2094463 to your computer and use it in GitHub Desktop.
Lerning Erlang 3 comparisons
1> atom > 5.
true
2> atom > complexAtom.
false
3> complexAtom > atom.
true
4> atom > "A".
false
5> "A" > atom.
true
6> atom < 45678.
false
7> atom < 456788909809890.
false
8> atom < {tuple}.
true
9> atom <[list].
true
10> [list] > {tuple, name}.
true
11> {atom,[1]} > {atom,two}.
true
12> {atom,[1]} > {atom,two,three}.
false
13> {atom, list} > {atom, two}.
false
1> "a" == "a".
true
2> "a" == [65].
false
3> true == true.
true
4> {atom, name} == {atom, name}.
true
5> {atom, name} == {atom}.
false
6> Phone = 4165551111.
7> phone == Phone.
false
8> 1 == 1.0.
true
9> 1 =:= 1.0.
false
10> "A" == [65].
true
11> "A" =:= [65].
true
1> 4 > 3.
true
2> 4 >= 4.
true
3> 4 > 4.
false
4> 5< 6.
true
5> 5 <= 5.
* 1: syntax error before: '<='
5> 5 =< 5.
true
6> 5 < 5.
false
1> 3 /= 4.
true
2> 3.0 /= 3.
false
3> 3.0 =/= 3.
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment