summaryrefslogtreecommitdiff
path: root/2.3-1/tests/unit_tests/test100_recursivefunctions/scilabcode/IterativePower.sci
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/tests/unit_tests/test100_recursivefunctions/scilabcode/IterativePower.sci')
-rw-r--r--2.3-1/tests/unit_tests/test100_recursivefunctions/scilabcode/IterativePower.sci17
1 files changed, 17 insertions, 0 deletions
diff --git a/2.3-1/tests/unit_tests/test100_recursivefunctions/scilabcode/IterativePower.sci b/2.3-1/tests/unit_tests/test100_recursivefunctions/scilabcode/IterativePower.sci
new file mode 100644
index 00000000..d3ee3469
--- /dev/null
+++ b/2.3-1/tests/unit_tests/test100_recursivefunctions/scilabcode/IterativePower.sci
@@ -0,0 +1,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