coerce and exact operators problem

Tony Pedley <>
Wed Jun 7 14:05:30 CEST 2000


Thanks, thats a relief, at least the stupidity factor has been removed
(for the time being anyway)



 wrote:

> Hi,
>
> The bug you demonstrate doesn't appear to be present in R6B, so I'd
> say it's a fixed bug. (I can reproduce it in R5b, but not in R6B). I
> couldn't find that bug listed in the release notes, though the runtime
> system release notes mention a fix for something similar.
>
> Matt
>
> Tony Pedley writes:
>
>  > 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:
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/1730f181/attachment.html>


More information about the erlang-questions mailing list