[mercury-users] difference between is and =?

Pablo Lopez lopez at lcc.uma.es
Fri Apr 27 21:49:56 AEST 2001



Terrence Brannon wrote:
> 
> in the last clause of this function, is is used instead of =. Why is
> this? In fact, what is is?
> 
> float__pow(X, Exp) = Ans :-
>         ( Exp < 0 ->
>                 error("float__pow taken with exponent < 0\n")
>         ; Exp = 1 ->
>                 Ans =  X
>         ; Exp = 0 ->
>                 Ans = 1.0
>         ;
>                 New_e is Exp - 1,
>                 Ans is X * float__pow(X, New_e)
>         ).
> 

I'm a newbie to Mercury, but I think
that according to the definition above

  float_plow(0,0) = 1

however, this should be undefined....
or am I missing the point???

  -- Pablo
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list