A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue