6
In Erlang, we have the following comparison operators:
=:=
=/=
==
/=
It is said that the latter two can be used to make comparison between integers and floats, since the first two differentiate one integer of float:
1 =:= 1.0. % false
1 == 1.0. % true
1 =/= 1.0. % true
1 /= 1.0. % false
In addition to this difference, there is some other divergence between the behaviour between the operators =:=
and =/=
of operators ==
and /=
?
From the documentation: == Equal to; /= Not Equal to; =< Less than or Equal to; < Less than; >= Greater than or Equal to; > Greater than; =:= Exactly Equal to; =/= Exactly not Equal to
– anonimo