# 2.16. testpow.bas

[<<<] [>>>]

This program tests the power operator. The power operator is quite complex, because it is implemented to result valid result in as many cases as possible.

Example testpow.bas :

```print "here comes a lot of 1:\n"
print 2 ^ 0
print -2 ^ 0
print 2.0 ^ 0
print -2.0 ^ 0
print "2" ^ 0
print "-2" ^ 0
print "2.0" ^ 0
print "-2.0" ^ 0
print
print "here comes\n2-22-22-22-2\n"
print 2 ^ 1
print -2 ^ 1
print 2.0 ^ 1
print -2.0 ^ 1
print "2" ^ 1
print "-2" ^ 1
print "2.0" ^ 1
print "-2.0" ^ 1
print " and it did!! I told you, believe me!\n"
print "here comes a lot of 4:\n"
print 2 ^ 2
print -2 ^ 2
print 2.0 ^ 2
print -2.0 ^ 2
print "2" ^ 2
print "-2" ^ 2
print "2.0" ^ 2
print "-2.0" ^ 2
print
print "2.2 ^ 2 =", 2.2 ^ 2," = ", 2.2*2.2
print
print 2.2 ^ -2, " should be the same as ", 1/ (2.2 ^2)
print
print 2.2 ^ (1/2), " should be same as ",sqr(2.2)
print
print 2.2 ^ -(1/2), " should be same as ", 1/ (2.2^(1/2))
print
print 2.2 ^ (-1/2), " last time this number"
print
print "again with strings\n"
print "2.2" ^ 2
print
print "2.2" ^ -2, " should be the same as ", 1/ (2.2 ^2)
print
print "2.2" ^ "0.5", " should be same as ",sqr(2.2)
print
print "2.2" ^ -(1/2), " should be same as ", 1/ (2.2^(1/2))
print
print "2.2" ^ (-1/2), " last time this number, ... really, I promise..."
print
print "1.0"/sqr("22E-1")
print
print "1.0"/sqr("2.2")
print
print "never trust a program! Any program, ever!\n"

```

Result executing testpow.bas :

```
```

Possible error messages sent to stderr:

```
```

[<<<] [>>>]