<html><body>
<p><font size="2" face="sans-serif">Hi Mehran,</font><br>
<br>
<font size="2" face="sans-serif">I can't give you any explanation (and I've never really questioned these points myself) but you may find some sections of these documents interesting or useful.  They both mention integer value ranges.</font><br>
<br>
<font size="2" face="sans-serif">     www.scilab.org/content/download/247/1702/file/introscilab.pdf                                   page 25</font><br>
<br>
<font size="2" face="sans-serif">     <a href="http://wiki.scilab.org/Tutorials?action=AttachFile&do=view&target=Scilab4Matlab.pdf">http://wiki.scilab.org/Tutorials?action=AttachFile&do=view&target=Scilab4Matlab.pdf</a>             page 18</font><br>
<br>
<br>
<font size="2" face="sans-serif">Best wishes,</font><br>
<font size="2" face="sans-serif">Adrian.</font><br>
<font size="2" face="sans-serif"><br>
</font>
<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td class="t" width="178" valign="middle">
<ul style="padding-left: 1pt"><font size="2" color="#333333" face="Arial"><b>Adrian Weeks </b></font><font size="1" color="#666666" face="Arial"><br>
Development Engineer <br>
<br>
 <br>
HID Global,<br>
3 Cae Gwyrdd,<br>
Green Meadow Springs<br>
Business Park,<br>
Cardiff CF15 7AB,<br>
United Kingdom.<br>
+44 (0)29 20528523 (Office)</font><font size="1" color="#0000FF" face="Arial"><u><br>
</u></font><a href="mailto:aweeks@hidglobal.com"><font size="1" color="#0000FF" face="Arial"><u>aweeks@hidglobal.com</u></font></a><font size="1" color="#0000FF" face="Arial"><u><br>
</u></font><a href="http://www.hidglobal.com/"><font size="1" color="#0000FF" face="Arial"><u>www.hidglobal.com</u></font></a></ul>
</td><td width="139" valign="middle">
<ul style="padding-left: 1pt"><a href="http://www.hidglobal.com/"><img src="cid:1__=0FBBF7B8DFBAC5098f9e8a93df93869@prox.com" width="130" height="170" border="0"></a></ul>
</td></tr>
</table>
<br>
<br>
<img width="16" height="16" src="cid:2__=0FBBF7B8DFBAC5098f9e8a93df93869@prox.com" border="0" alt="Inactive hide details for A Khorshidi ---05/08/2014 07:36:31---Hi;  One reason for using integer type is to save memory space, "><font size="2" color="#424282" face="sans-serif">A Khorshidi ---05/08/2014 07:36:31---Hi;  One reason for using integer type is to save memory space, isn't it?</font><br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:3__=0FBBF7B8DFBAC5098f9e8a93df93869@prox.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">From:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:3__=0FBBF7B8DFBAC5098f9e8a93df93869@prox.com" border="0" alt=""><br>
<font size="1" face="sans-serif">A Khorshidi <akhorshidi@live.com></font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:3__=0FBBF7B8DFBAC5098f9e8a93df93869@prox.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">To:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:3__=0FBBF7B8DFBAC5098f9e8a93df93869@prox.com" border="0" alt=""><br>
<font size="1" face="sans-serif">Scilab Users <users@lists.scilab.org></font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:3__=0FBBF7B8DFBAC5098f9e8a93df93869@prox.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">Date:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:3__=0FBBF7B8DFBAC5098f9e8a93df93869@prox.com" border="0" alt=""><br>
<font size="1" face="sans-serif">05/08/2014 07:36</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:3__=0FBBF7B8DFBAC5098f9e8a93df93869@prox.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">Subject:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:3__=0FBBF7B8DFBAC5098f9e8a93df93869@prox.com" border="0" alt=""><br>
<font size="1" face="sans-serif">[Scilab-users] Scilab and Matlab integer representation</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:3__=0FBBF7B8DFBAC5098f9e8a93df93869@prox.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">Sent by:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:3__=0FBBF7B8DFBAC5098f9e8a93df93869@prox.com" border="0" alt=""><br>
<font size="1" face="sans-serif">"users" <users-bounces@lists.scilab.org></font></td></tr>
</table>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<font size="3" face="Calibri">Hi; <br>
<br>
One reason for using integer type is to save memory space, isn't it? <br>
However, whos() gives us 24 bytes as storage space for both integer and double data types.<br>
<br>
var1 = int8(23); // 1 byte integer representation<br>
whos -name var1<br>
var2 = 23;<br>
whos -name var2<br>
<br>
In contrast, Matlab's whos() returns 1 byte for int8 data type and 8 bytes for double precision number. <br>
<br>
And another case, <br>
For values larger than the maximum value of a given integer data type (e.g. 127 for int8) Scilab and Matlab return different values. <br>
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). <br>
<br>
Could anyone discuss on these different results returned by Scilab and Matalb? And specially the source of the differences? Thank you.<br>
<br>
Regards,  <br>
Mehran<br>
_<br>
</font><tt><font size="2">_______________________________________________<br>
users mailing list<br>
users@lists.scilab.org<br>
</font></tt><tt><font size="2"><a href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a></font></tt><tt><font size="2"><br>
</font></tt><br>
<br>
</body></html>