Availability:Arithmetic function (see is/2)
[ISO]+Expr1 ^ +Expr2In SWI-Prolog, ^/2 is
equivalent to **/2. The
ISO version is similar, except that it produces a evaluation error if
both
Expr1 and Expr2 are integers and the result is not
an integer. The table below illustrates the behaviour of the
exponentiation functions in ISO and SWI.
| Expr1 | Expr2 | Function | SWI | ISO |
| Int | Int | **/2 | Int
or Float | Float |
| Int | Float | **/2 | Float | Float |
| Rational | Int | **/2 | Rational | - |
| Float | Int | **/2 | Float | Float |
| Float | Float | **/2 | Float | Float |
| Int | Int | ^/2 | Int
or Float | Int or error |
| Int | Float | ^/2 | Float | Float |
| Rational | Int | ^/2 | Rational | - |
| Float | Int | ^/2 | Float | Float |
| Float | Float | ^/2 | Float | Float |