I found the problem. Blitz uses the formula Exp(y * Log(x)) to find x^y. The problem is that Log() and Exp() work on doubles and floating point numbers are subject to rounding errors. If you make calc a float, you'll see that it calculates 2^3 to 7.9999999 which when converted to int, becomes 7. If you change the program to read
Then the result will be correct.
Local calc = (2^num)+.5
Then the result will be correct.