[erlang-questions] Strange behaviour of =:= applied to int and int64

Dmitry Groshev <>
Wed Sep 7 15:42:19 CEST 2011


I'm using R14B03 and writing a little NIF library. Today I've
encountered a strange behaviour of =:= when it is used against number
that is set in sources and term that was constructed as
enif_make_unit64. Here is an example:

()1> {ok, T} = ecirca:new(5, last, small).
{ok,{ecirca,#Ref<0.0.0.57>,<<>>,<0.48.0>,small}}
()2> {ok, A} = ecirca:size(T).
{ok,5}
()3> B = 5.
5
()4> A == B.
true
()5> A =:= B.
false
()6> A.
5
()7> B.
5

This behaviour looks quite weird to me. Is it expected?



More information about the erlang-questions mailing list