coerce and exact operators problem

Tony Pedley tonyp@REDACTED
Wed Jun 7 13:28:08 CEST 2000


Excuse me for my stupidity but could anyone explain why the coerce and exact operators do not work
as advertised....

% Surely one must match......

match(X) ->
    io:format("when X is ~p\nX==0 results in ~p\nX=:=0 results in ~p\n",[X,X==0,X=:=0]),
    if
       X == 0 ->
           coerce_match;
       X =:= 0 ->
           exact_match;
       true  ->
           no_match
end.

------------------------------>

41> tmp:match(0.0).

when X is 0.00000e+0,
X==0 results in true
X=:=0 results in false
no_match



--
______________________________________________________________________
Tony Pedley             mailto:tonyp@REDACTED
Ericsson Intracom Ltd.  Intranet : http://intracom.ericsson.se
1 Bede Island           Internet : http://www.ericsson.co.uk/datacom/index.htm
Leicester               memoID  : ECOM.CBERAM
England                 Tel  : +44 (0)116 2 542 400
LE2 7EU                 Fax  : +44 (0)116 2 046 111
______________________________________________________________________


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20000607/e802654b/attachment.htm>


More information about the erlang-questions mailing list