problem with clause "double" of sum function ?
CRETE Denis
denis.crete at thalesgroup.com
Thu Aug 11 12:14:49 CEST 2011
Hello,
I am puzzled by the behaviour of this piece of code:
N=21;M=4;
A=floor(256*rand(N,M)); // Build random matrix
B=uint8(A); // Conversion to integer
max(abs(sum(B,2,"double")-sum(A,2))) // Should return 0
It returns 0 for specific values of (N,M), e.g. when (N<14,M<4) and when (N<7*M-7,M>=4) !?!
(I am using Scilab 5.3.2 on PC/Windows XP)
The manual says that the first argument of "sum" is an array of real, complex, boolean, polynoms or rational fractions: does it mean that integers are excluded ? Why ?
Thanks for any explanation
Denis
More information about the users
mailing list