Hello Mehran,

Le 05/08/2014 08:35, A Khorshidi a écrit :
Hi;

One reason for using integer type is to save memory space, isn't it?
However, whos() gives us 24 bytes as storage space for both integer and double data types.

A scalar number is considered as a 1x1 matrix. For any matrix, some room is needed to record the number of rows, of columns, the type of the matrix, etc. If you do the same test for a large matrix, the memory used becomes asymptotically proportionnal to the matrix size:

-->var1 = int8(rand(1000,1000)*64); // 1 byte integer representation
-->whos -name var1
Name                     Type           Size           Bytes

var1                     int8           1000 by 1000   1000024

The way how Scilab stores variables in memory is described here:
http://wiki.scilab.org/Memory%20representation%20of%20variables

Best regards
Samuel
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to