summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorsimon2009-08-07 08:41:10 +0000
committersimon2009-08-07 08:41:10 +0000
commitc8c6368cd58dbd17f75a76f6dd2399b7b3d7a71c (patch)
tree9a591306f7c75a5296df0e5d635272f5564583b6 /macros
parentc76ca1b96e718c7ebfa986be8bf67663a2c468ae (diff)
downloadscilab2c-c8c6368cd58dbd17f75a76f6dd2399b7b3d7a71c.tar.gz
scilab2c-c8c6368cd58dbd17f75a76f6dd2399b7b3d7a71c.tar.bz2
scilab2c-c8c6368cd58dbd17f75a76f6dd2399b7b3d7a71c.zip
improved FA_SZ_FROM_VAL to make it more generic
Diffstat (limited to 'macros')
-rw-r--r--macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci23
1 files changed, 17 insertions, 6 deletions
diff --git a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci
index e9d88650..238bfc20 100644
--- a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci
+++ b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci
@@ -11,16 +11,27 @@ function opout = FA_SZ_FROM_VAL(in1)
//
// -----------------------------------------------------------------
-SCI2CNInArgCheck(argn(2),1,1);
+SCI2CNInArgCheck(argn(2),1,1);
-in1num = eval(in1) ;
-
-if ( in1num < 0 )
+
+if (SCI2Cisnum(in1))
+ in1num = eval(in1) ;
+ if isnan(in1num)
+ opout = '__SCI2CNANSIZE';
+ elseif ( in1num < 0 )
opout= '0' ;
-else
+ else
opout = string ( floor (abs(in1num))) ;
+
+ end
+
+
+else
+ opout = in2+"0floor"+in2+"0"+"("+in1+")";
+ opout = in2+"0abs"+in2+"0"+"("+opout+")";
+
end
-endfunction
+endfunction