summaryrefslogtreecommitdiff
path: root/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci
diff options
context:
space:
mode:
authorSiddhesh Wani2015-05-25 14:46:31 +0530
committerSiddhesh Wani2015-05-25 14:46:31 +0530
commitdb464f35f5a10b58d9ed1085e0b462689adee583 (patch)
treede5cdbc71a54765d9fec33414630ae2c8904c9b8 /macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci
downloadScilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.tar.gz
Scilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.tar.bz2
Scilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.zip
Original Version
Diffstat (limited to 'macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci')
-rw-r--r--macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci36
1 files changed, 36 insertions, 0 deletions
diff --git a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci
new file mode 100644
index 0000000..c3cae53
--- /dev/null
+++ b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci
@@ -0,0 +1,36 @@
+function opout = FA_SZ_FROM_VAL(in1,in2)
+// function opout = FA_SZ_FROM_VAL(in1,in2)
+// -----------------------------------------------------------------
+// Return a size according to the floored value of the first argument
+//
+// Input data:
+// in1: string specifying a number .
+//
+// Output data:
+// opout: string containing the computed result.
+//
+// -----------------------------------------------------------------
+
+SCI2CNInArgCheck(argn(2),2,2);
+
+
+if (isnum(in1))
+ in1num = eval(in1) ;
+ if isnan(in1num)
+ opout = '__SCI2CNANSIZE';
+ elseif ( in1num < 0 )
+ opout= '0' ;
+ else
+ opout = string ( floor (abs(in1num))) ;
+
+ end
+
+
+else
+ opout = in2+"0floor"+in2+"0"+"("+in1+")";
+ opout = in2+"0abs"+in2+"0"+"("+opout+")";
+
+end
+
+
+endfunction: