summaryrefslogtreecommitdiff
path: root/2.3-1/tests/unit_tests/test100_recursivefunctions/scilabcode/IterativePower.sci
blob: d3ee34698b61f2f5234fd2437a5db869901be547 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//SCI2C: NIN=          2
//SCI2C: NOUT=         1
//SCI2C: OUT(1).TP=    IN(1).TP
//SCI2C: OUT(1).SZ(1)= FA_SZ_1(IN(1).SZ)
//SCI2C: OUT(1).SZ(2)= FA_SZ_2(IN(1).SZ)
//SCI2C: DEFAULT_PRECISION= FLOAT

function outiter = IterativePower(in,pwrfct)

outiter = ones(in); 

for cnt = 1:pwrfct
   mytmp = outiter .* in;
   outiter = mytmp;
end

endfunction