summaryrefslogtreecommitdiff
path: root/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/auxiliaryFunctions/mainfunctionSign.sci
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/auxiliaryFunctions/mainfunctionSign.sci')
-rw-r--r--2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/auxiliaryFunctions/mainfunctionSign.sci28
1 files changed, 28 insertions, 0 deletions
diff --git a/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/auxiliaryFunctions/mainfunctionSign.sci b/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/auxiliaryFunctions/mainfunctionSign.sci
new file mode 100644
index 00000000..6a1ce45c
--- /dev/null
+++ b/2.3-1/src/Scilab2C/SCI2CTests/Mes_tests/auxiliaryFunctions/mainfunctionSign.sci
@@ -0,0 +1,28 @@
+//SCI2C: DEFAULT_PRECISION= DOUBLE
+
+function mainfunction()
+
+//test sign
+
+//real
+disp (sign(4))
+disp (sign(0))
+disp (sign(-2))
+
+a=[1 0 5 4; -2 4 0 5 ; -4 -2 -1 4]
+disp (sign(a))
+
+
+//complex
+disp (sign(4-2*%i))
+disp (sign(4+2*%i))
+disp (sign(0+%i*0))
+disp (sign(3+%i*0))
+disp (sign(0+%i*3))
+disp (sign(-2 - 2*%i))
+disp (sign(-2 + 2*%i))
+
+b=[1+%i 0+0*%i 5-2*%i 4+0*%i; -2+%i 4 0+2*%i 5 ; -4-3*%i -2 -1-3*%i 4+2*%i]
+disp (sign(b))
+
+endfunction