[Scilab-users] Scilab and Matlab integer representation
aweeks at hidglobal.com
aweeks at hidglobal.com
Tue Aug 5 09:38:17 CEST 2014
Hi Mehran,
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.
www.scilab.org/content/download/247/1702/file/introscilab.pdf
page 25
http://wiki.scilab.org/Tutorials?action=AttachFile&do=view&target=Scilab4Matlab.pdf
page 18
Best wishes,
Adrian.
Adrian Weeks
Development Engineer
HID Global,
3 Cae Gwyrdd,
Green Meadow Springs
Business Park,
Cardiff CF15 7AB,
United Kingdom.
+44 (0)29 20528523
(Office)
aweeks at hidglobal.com
www.hidglobal.com
From: A Khorshidi <akhorshidi at live.com>
To: Scilab Users <users at lists.scilab.org>
Date: 05/08/2014 07:36
Subject: [Scilab-users] Scilab and Matlab integer representation
Sent by: "users" <users-bounces at lists.scilab.org>
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
_
_______________________________________________
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/20140805/e5f48c54/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 12347310.gif
Type: image/gif
Size: 4559 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140805/e5f48c54/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140805/e5f48c54/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140805/e5f48c54/attachment-0002.gif>
More information about the users
mailing list