Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    How about the last parameter in the base case? pow(_,0,1). I understand the first parameter is anonymous, so we dont care about it, the second parameter is obvious, but I dont understand how the '1' is reached. Thanks! Commented Oct 17, 2011 at 21:03
  • 1
    pow(X,0,1) is a fact. It means that whatever X you take to the power of 0 yields 1. if you only use that fact you can ask prolog questions like: pow(48,0,X). and it will answer that X = 1 Commented Oct 17, 2011 at 22:05