diff options
author | simon | 2009-08-07 08:41:10 +0000 |
---|---|---|
committer | simon | 2009-08-07 08:41:10 +0000 |
commit | c8c6368cd58dbd17f75a76f6dd2399b7b3d7a71c (patch) | |
tree | 9a591306f7c75a5296df0e5d635272f5564583b6 /macros/FunctionAnnotation | |
parent | c76ca1b96e718c7ebfa986be8bf67663a2c468ae (diff) | |
download | scilab2c-c8c6368cd58dbd17f75a76f6dd2399b7b3d7a71c.tar.gz scilab2c-c8c6368cd58dbd17f75a76f6dd2399b7b3d7a71c.tar.bz2 scilab2c-c8c6368cd58dbd17f75a76f6dd2399b7b3d7a71c.zip |
improved FA_SZ_FROM_VAL to make it more generic
Diffstat (limited to 'macros/FunctionAnnotation')
-rw-r--r-- | macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci | 23 |
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 |