Dear Samuel!


Many thanks!



For me there is no problem to run SciLab as admin, use edit %s_i_s (i=1:4) and 
add



else

    TF=%f



or



else

    error("Comparison of complex numbers is undefined")



etc.



The error is a good idea. It is more correct that in MatLab (comparing of the 
real part only). But %NAN is also possible, meaning that the operation can not 
provide any "logical number", 1 (%t) or 0 (%f).


If x<%i is false then x>=%i can also be false, such as x<%nan and x>=%nan. In 
this case, %f in "if" or "while" gives the same result but without changing of 
type of the comparing result from 4 to 1.


Nevertheless, %NAN is more correct (IMHO), especially in boolean expressions 
outside the "if" of "while" conditions. It is possible to use:



if a<b then

elseif a>=b then

else

    //a or/and b is/are %nan or complex.

end



With best regards.

Viktor.





14 серпня 2017, 14:38:33, від "Samuel Gougeon" <[email protected]>:


Le 14/08/2017 à 12:14, Viktor Mileikovskyi a écrit :
Dear Developers!


The bug 15184 has been successfully fixed in 6.0 branch 
At least, the crash no longer occurs.
However, when we try to compare a complex to a real like with 2<%i, an error 
should be yielded instead of returning %F. Otherwise, the complementary 
comparison 2>=%i could be interpreted as %T, what is definitely not the case.
So: when such a comparison is done, we may test the existence of 
%s_1_s_custom() , that may be defined in an external way (%s_1_s() being 
already defined in Scilab).
 * If it exists: we call it
 * otherwise, we yield an error with a message inviting the user to define 
%s_1_s_custom()

I will propose a commit in this way, on the 6.0 branch.

Samuel

_______________________________________________
dev mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/dev





--
E-Mail: [email protected]
E-Mail: [email protected]
Skype: mileikovskyi
Mob: +38-044-2284247
Mob: +38-094-8284247



_______________________________________________
dev mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/dev

Reply via email to