diff options
Diffstat (limited to '2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations')
4 files changed, 222 insertions, 0 deletions
diff --git a/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations/mainfunctionOpMinus.sci b/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations/mainfunctionOpMinus.sci new file mode 100644 index 00000000..4445143b --- /dev/null +++ b/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations/mainfunctionOpMinus.sci @@ -0,0 +1,50 @@ +//SCI2C: DEFAULT_PRECISION= DOUBLE +function mainfunction()
+ +//test soustraction + +//d0d0 +disp (5-3) +//d0z0 +disp (1-%i) +//z0d0 +disp (%i-1) +//z0z0 +disp (%i-3*%i) + +a=[1 2 3; 4 5 6] +c=[1 5 3; 7 0 5] +b=[1+%i,2+4*%i 3+1*%i; 4 5 6+2*%i] +d=[1+%i,5+%i 3; 7+3*%i 0 5] + +//d2d2 +disp(a-c) +disp(a-a) +//d2z2 +disp(a-d) +//z2d2 +disp(d-a) +//z2z2 +disp(b-b) +disp(b-d) + +//d2d0 +disp(a-1) +//d0d2 +disp(1-a) +//d2z0 +disp(a-%i) +//z0d2 +disp(%i-a) + + +//z2d0 +disp(b-1) +//d0z2 +disp(1-b) +//z2z0 +disp(b-%i) +//z0z2 +disp(%i-b) + +endfunction diff --git a/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations/mainfunctionOpPlus.sci b/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations/mainfunctionOpPlus.sci new file mode 100644 index 00000000..3cef1468 --- /dev/null +++ b/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations/mainfunctionOpPlus.sci @@ -0,0 +1,47 @@ +//SCI2C: DEFAULT_PRECISION= DOUBLE +function mainfunction()
+ +//test addition + +//d0d0 +disp (1+1) +//d0z0 +disp (1+%i) +//z0d0 +disp (%i+1) +//z0z0 +disp (%i+%i) + +a=[1 2 3; 4 5 6] +b=[1+%i,2 3; 4 5 6] + + +//d2d2 +disp(a+a) +//d2z2 +disp(a+b) +//z2d2 +disp(b+a) +//z2z2 +disp(b+b) + +//d2d0 +disp(a+1) +//d0d2 +disp(1+a) +//d2z0 +disp(a+%i) +//z0d2 +disp(%i+a) +//z2z2 + +//z2d0 +disp(b+1) +//d0z2 +disp(1+b) +//z2z0 +disp(b+%i) +//z0z2 +disp(%i+b) + +endfunction diff --git a/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations/mainfunctionOpSlash_OpDotSlash.sci b/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations/mainfunctionOpSlash_OpDotSlash.sci new file mode 100644 index 00000000..5523a19f --- /dev/null +++ b/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations/mainfunctionOpSlash_OpDotSlash.sci @@ -0,0 +1,67 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function mainfunction()
+ +//test division + +//d0d0 +disp (5/3) +//d0z0 +disp (1/%i) +//z0d0 +disp (%i/5) +//z0z0 +disp (%i/(3*%i)) + +a=[1 2 3; 5 5 6] +c=[4 2 3 ;8 8 4; 3 4 5] +b=[1+%i,2+4*%i 3+1*%i; 4 5 6+2*%i] +d=[4 2 3 ;8 8-1*%i 4; 3+4*%i 4 5] + +//d2d2 +disp("d2d2") +disp(a/c) +disp(a./a) +//d2z2 +disp("d2z2") +disp(a/d) +disp(a./b) +//z2d2 +disp("z2d2") +disp(d/c) +disp(b./a) +//z2z2 +disp("z2z2") +disp(b/d) +disp(b./b) + + + + +//d2d0 +disp("d2d0") +disp(a/2) +//d0d2 +disp("d0d2") +disp(1/c) +//d2z0 +disp("d2z0") +disp(a/%i) +//z0d2 +disp("z0d2") +disp(%i/c) + + +//z2d0 +disp("z2d0") +disp(b/5) +//d0z2 +disp("d0z2") +disp(1/d) +//z2z0 +disp("z2z0") +disp(b/%i) +//z0z2 +disp("z0z2") +disp(%i/d) + +endfunction diff --git a/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations/mainfunctionOpStar_OpDotStar.sci b/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations/mainfunctionOpStar_OpDotStar.sci new file mode 100644 index 00000000..93d50258 --- /dev/null +++ b/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/operations/mainfunctionOpStar_OpDotStar.sci @@ -0,0 +1,58 @@ +//SCI2C: DEFAULT_PRECISION= DOUBLE +function mainfunction() + +//test multiplication + +//d0d0 +disp (5/3) +//d0z0 +disp (1/%i) +//z0d0 +disp (%i/5) +//z0z0 +disp (%i/(3*%i)) + +a=[1 2 3; 4 5 6] +c=[4 2 3 ;8 8 4; 3 4 5] +b=[1+%i,2+4*%i 3+1*%i; 4 5 6+2*%i] +d=[4 2 3 ;8 8-1*%i 4; 3+4*%i 4 5] +e=[4 2 ;3 8 ;8-1*%i 4; 3+4*%i 4] + +//d2d2 +disp(a*c) +disp(a.*a) +//d2z2 +disp(a*d) +disp(a.*b) +//z2d2 +disp(e*a) +disp(b.*a) +//z2z2 +disp(b*d) +disp(b.*b) + + + + +//d2d0 +disp(a*1) +//d0d2 +disp(1*a) +//d2z0 +disp(a*%i) +//z0d2 +disp(%i*a) + + +//z2d0 +disp(b*1) +//d0z2 +disp(1*b) +//z2z0 +disp(b*%i) +//z0z2 +disp(%i*b) + +endfunction + + |