This commit is contained in:
Ingy döt Net 2013-04-10 21:29:02 -07:00
parent 764da6cbbb
commit db842d013d
19005 changed files with 197040 additions and 7 deletions

View file

@ -0,0 +1,25 @@
print " 11^5 = ", floatPow( 11, 5 )
print " (-11)^5 = ", floatPow( -11, 5 )
print " 11^( -5) = ", floatPow( 11, -5 )
print " 3.1416^3 = ", floatPow( 3.1416, 3 )
print " 0^2 = ", floatPow( 0, 2 )
print " 2^0 = ", floatPow( 2, 0 )
print " -2^0 = ", floatPow( -2, 0 )
end
function floatPow( a, b)
if a <>0 then
m =1
if b =abs( b) then
for n =1 to b
m =m *a
next n
else
m =1 /floatPow( a, 0 - b) ' LB has no unitary minus operator.
end if
else
m =0
end if
floatPow =m
end function