[Scilab-users] undocumented behavior of sum(), prod() and type()

Samuel Gougeon sgougeon at free.fr
Sun Feb 9 04:40:11 CET 2020


Hello federico,

The empty page is improved in 6.1.0. Please have a look to
http://bugzilla.scilab.org/15431
http://bugzilla.scilab.org/attachment.cgi?id=4929

Thanks
Samuel

Le 09/02/2020 à 04:27, Federico Miyara a écrit :
>
> Dear all,
>
> I note that sum([]) yields 0 instead of []. This is somewhat 
> contradictory with the documented behavior that [] + n yields [] 
> regardless of the type of n
>
> I allso find that prod([]) yields 1. This is even stranger. The common 
> feature is that both are the respective neutral element of the operations.
>
> Interestingly, cumsum and cumprod applied to [] yield the expected 
> result, []
>
> Besides, type([]) is 1 (constant). Somehow it is asuming an empty 
> matrix is by default a container for constants, even in csses such as 
> the following:
>
> a = %s
> b = a(1:$-1)
>
> where b is an empty sub-vector of a polynomial vector.
>
> None of these behaviors seem to be documented. If intentional, they 
> should be documented.
>
> Regards,
>
> Federico Miyara
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20200209/4e873cba/attachment.htm>


More information about the users mailing list