I have no idea if this will work but I sort of combined Shawn's & Richard's snibbets to get this.
Code:
Function Pwr($b,$e)
Dim $t
If (vartype($b)<2 or vartype($b)>6)
$Pwr=0.0
Exit 10
EndIf
If (vartype($e)<2 or vartype($e)>6)
$Pwr=0.0
Exit 20
EndIf
$System = CreateObject("Kixtart.System")
; Math object
$Math = $System.Math()
If ($e=0)
$Pwr=1.0
Else
If ($b=0 or $b=1)
$Pwr=$b
Else
If (vartype($e)=2 or vartype($e)=3 or CDbl(int($e))=$e)
$t=int(abs($e))
$Pwr=1.0
While $t
$Pwr=$Pwr*$b
$t=$t-1
Loop
If ($e<0)
$Pwr=1.0/$Pwr
EndIf
Else
If ($b<0)
$Pwr=0.0
Exit 11
EndIf
$t = $Math.log($b)*$e
$Pwr = $Math.exp($t)
EndIf
Endif
EndIf
EndFunction
I am assuming that the function Log() is the natural logarithm function. If it isn't you will need to subsitute the correct function.
Edited by Jack Lothian (2004-01-27 11:01 PM)
_________________________
Jack