summaryrefslogtreecommitdiff
path: root/2.3-1/tests/unit_tests/double/test_OpPlus.sci
blob: ccdba91f1d21f28d58a436a5626ef60008d1d46d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function test_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
endfunction