[Scilab-users] slight bug in exists()

Federico Miyara fmiyara at fceia.unr.edu.ar
Tue Feb 9 09:49:51 CET 2021


Antoine,

Well, to be sure, there are some functions that do not work on booleans. 
For instance, mean(), max() and mean() will cause error; but not sum() 
and prod().

However, I think exists() is used mostly in conditionals, where both 
types work fine. And if getting errors, they can be easily solved by 
using double() to convert to double. This workaround could be included 
in the documentation.

If not fixed in this release, a warning could be issued in the 
documentation that the current output argument type will be changed to 
boolean in the next release.

Federico Miyara


On 09/02/2021 00:27, Antoine Monmayrant wrote:
>
> Hello Federico,
>
> I agree with you that this would make more sense.
> Could such a change be implemented for a point release?
> I assume it would introduce some bugs in existing code relying on the 
> (unusual) double output...
>
> Antoine
>
> On 09/02/2021 03:24, Federico Miyara wrote:
>>
>> Dear all,
>>
>> I had already mentioned this a while ago 
>> (http://mailinglists.scilab.org/Scilab-users-exists-yields-double-tt4039853.html), 
>> but as I guess we are in the update season, it would be good 
>> opportunity to fix this (if there isn't strong opposition, or a good 
>> reason for this behavior, of course).
>>
>> I'm referring to the fact that the function exists() should by nature 
>> yield a Boolean result such as T or F. However, it yields 1 or 0. 
>> While this is not a big deal, similar functions performing a binary 
>> decision on their arguments, such as isreal(), isvector(), isfile() 
>> and many others, yield Boolean results.
>>
>> Regards,
>>
>> Federico Miyara
>>
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> 
>> 	Libre de virus. www.avast.com 
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> 
>>
>>
>> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>> _______________________________________________
>> users mailing list
>> users at lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users



-- 
El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20210209/376ff8f2/attachment.htm>


More information about the users mailing list