Exactly what's the prolog definition for power function. I wrote this code and it give some errors I wanna know exact code for the power function.
pow(X,0,1).
pow(X,Y,Z):-Y1=Y-1,pow(X,Y1,Z1),Z1=Z*X.
Anything wrong with this code?
(define (member atom list)
(cond
((null? list) '())
(= atom (car list) "True")
(else
(member atom(cdr list)))
)
)
(member '5 '(1 2 3 4 5))
Always it gives true even though that atom isn't a member in the list. Could you plz help me to clarify this question as soon as possible.