[Scilab-Dev] Bug 15184

Viktor Mileikovskyi v_mil at ukr.net
Mon Aug 14 14:50:15 CEST 2017


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" <sgougeon at free.fr>:


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
dev at lists.scilab.org
http://lists.scilab.org/mailman/listinfo/dev





--
E-Mail: v_mil at ukr.net
E-Mail: mileikovskyi at gmail.com
Skype: mileikovskyi
Mob: +38-044-2284247
Mob: +38-094-8284247



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20170814/79e41eb4/attachment.htm>


More information about the dev mailing list