[Scilab-users] Scilab and Matlab integer representation

A Khorshidi akhorshidi at live.com
Tue Aug 5 08:35:54 CEST 2014




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.

var1 = int8(23); // 1 byte integer representation
whos -name var1
var2 = 23;
whos -name var2

In contrast, Matlab's whos() returns 1 byte for int8 data type and 8 bytes for double precision number. 

And another case, 
For values larger than the maximum value of a given integer data type (e.g. 127 for int8) Scilab and Matlab return different values. 
For example, Scilab's result for int8(200) is -56 but Matlab's result will be 127 (the largest value which can be stored in this data type). 

Could anyone discuss on these different results returned by Scilab and Matalb? And specially the source of the differences? Thank you.

Regards,  
Mehran
_


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


More information about the users mailing list