<html>
<head>
<base href="http://bugzilla.scilab.org/" />
</head>
<body><br>
---------- Bug Summary ----------- <br>mtlb_int16: A GOOD compatibility bug :~))) Should be mentioned in Help/Doc Matlab (code <br><br>
<br>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - mtlb_int16: A GOOD compatibility bug :~))) Should be mentioned in Help/Doc Matlab (code"
href="http://bugzilla.scilab.org/show_bug.cgi?id=6729#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - mtlb_int16: A GOOD compatibility bug :~))) Should be mentioned in Help/Doc Matlab (code"
href="http://bugzilla.scilab.org/show_bug.cgi?id=6729">bug 6729</a>
from <span class="vcard"><a class="email" href="mailto:sgougeon@free.fr" title="Samuel GOUGEON <sgougeon@free.fr>"> <span class="fn">Samuel GOUGEON</span></a>
</span></b>
<pre>All mtlb_int#() and mtlb_uint#() functions were almost always wrong:
A) They saturated (instead of wrapping) only for -inf and + inf. Otherwise they wrapped:
-------------------------------------------------------------------------------------
--> mtlb_int8(-130)
ans =
126 // wrapped, instead of saturating to -128
--> mtlb_int8(130)
ans =
-126 // wrapped, instead of saturating to 127
--> mtlb_uint8(-1)
ans =
255 // wrapped, instead of saturating to 0
--> mtlb_uint8(260)
ans =
4 // wrapped, instead of saturating to 255
Same thing for mtlb_int16, mtlb_uint16, mtlb_int32, and mtlb_uint32
B) They truncated the decimal part instead of rounding to the nearest integer
--------------------------------------------------------------------------
--> mtlb_int8(-23.7)
ans =
-23 // -24 expected
--> mtlb_int8(-23.5)
ans =
-23 // -24 expected
--> mtlb_int8(23.5)
ans =
23 // 24 expected
--> mtlb_int8(23.7)
ans =
23 // 24 expected
Same thing for mtlb_uint8, mtlb_int16, mtlb_uint16, mtlb_int32, and mtlb_uint32.
C) mtlb_int64() and mtlb_uint64() were not available
-------------------------------------------------
--> mtlb_int64(2^38)
Undefined variable: mtlb_int64
--> mtlb_uint64(2^38)
Undefined variable: mtlb_uint64
I am going to commit a fix.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>