summaryrefslogtreecommitdiff
path: root/tests/unit_tests/float/test_float_OpPlus.sci
diff options
context:
space:
mode:
authoryash11122017-07-07 21:20:49 +0530
committeryash11122017-07-07 21:20:49 +0530
commit3f52712f806fbd80d66dfdcaff401e5cf94dcca4 (patch)
treea8333b8187cb44b505b9fe37fc9a7ac8a1711c10 /tests/unit_tests/float/test_float_OpPlus.sci
downloadScilab2C_fossee_old-3f52712f806fbd80d66dfdcaff401e5cf94dcca4.tar.gz
Scilab2C_fossee_old-3f52712f806fbd80d66dfdcaff401e5cf94dcca4.tar.bz2
Scilab2C_fossee_old-3f52712f806fbd80d66dfdcaff401e5cf94dcca4.zip
sci2c arduino updated
Diffstat (limited to 'tests/unit_tests/float/test_float_OpPlus.sci')
-rw-r--r--tests/unit_tests/float/test_float_OpPlus.sci49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/unit_tests/float/test_float_OpPlus.sci b/tests/unit_tests/float/test_float_OpPlus.sci
new file mode 100644
index 0000000..0f2b96e
--- /dev/null
+++ b/tests/unit_tests/float/test_float_OpPlus.sci
@@ -0,0 +1,49 @@
+//SCI2C: DEFAULT_PRECISION= FLOAT
+function test_float_OpPlus()
+ a = 1;
+ b = 2;
+ c = a + b; // d0d0OpPlusd0
+
+ d = 1 + %i; // d0z0OpPlusz0
+ e = %i + 3; // z0d0OpPlusz0
+ f = d + e; // z0z0OpPlusz0
+
+ g = [1 2 3; 4 5 6];
+ h = 10;
+ w = g + h; // d2d0OpPlusd2
+ j = h + g; // d0d2OpPlusd2
+
+ k = [9 8 7; 6 5 4; 3 2 1]
+ l = [1 2 3; 4 5 6; 7 8 9]
+ m = k + l // d2d2OpPlusd2
+
+ n = k + 2 * %i; //d2z0OpPlusz2
+ o = 3 * %i + l; //z0d2OpPlusz2
+ p = n + o; // z2z2OpPlusz2
+
+ q = [1 2 3 ; 4 5 6 ; 7 8 9]
+ r = 3 * %i;
+ s = q + r; // d2z0OpPlusz2
+ t = r + q; // z0d2OpPlusz2
+
+ u = [1 2 3] + %i * [4 5 6]
+ v = [7 8 9]
+ x = u + v; // z2d2OpPlusz2
+ y = v + u; // d2z2OpPlusz2
+
+
+ disp(c);
+ disp(d);
+ disp(e);
+ disp(f);
+ disp("");
+ disp(w);
+ disp(j);
+ disp(m);
+ disp(p);
+ disp(s);
+ disp(t);
+ disp(x);
+ disp(y);
+
+endfunction