How about:
Code:
 

Function Pwr($BV,Optional $PV)

DIM $z,$loop

if not $PV
$PV = 2.0
else
$PV = int($PV)
endif

$z = $BV * 1.0
$BV = $BV * 1.0
for $loop = 1 to $PV-1
$z = $z * $BV
EndIf
next
$Pwr = $z
EndFunction



This returned:
Code:
 
Pwr(2, 7) ? 128
Pwr(2, 8) ? 256
Pwr(-2,7) ? -128
Pwr(-2,8) 256
Pwr(1.5,3) 3.375
Pwr(9) 81



I'm not sure if you wanted fractional or negative exponents, but that would require that I look it up..

Glenn
_________________________
Actually I am a Rocket Scientist! \:D