Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
ni = int(rand * 10)
|
||||
nf = round(rand * 10, 4)
|
||||
ex = int(rand * 10)
|
||||
print " "; ni; " ^ "; ex; " = "; iPow (ni, ex)
|
||||
print nf; " ^ "; ex; " = "; fPow (nf, ex)
|
||||
end
|
||||
|
||||
function iPow (base, exponent)
|
||||
if exponent = 0 then return 1
|
||||
if exponent = 1 then return base
|
||||
if exponent < 0 then return 1 / iPow(base, -exponent)
|
||||
power = base
|
||||
for i = 2 to exponent
|
||||
power *= base
|
||||
next
|
||||
return power
|
||||
end function
|
||||
|
||||
function fPow (base, exponent)
|
||||
if exponent = 0.0 then return 1.0
|
||||
if exponent = 1.0 then return base
|
||||
if exponent < 0.0 then return 1.0 / fPow(base, -exponent)
|
||||
power = base
|
||||
for i = 2 to exponent
|
||||
power *= base
|
||||
next
|
||||
return power
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue