<html>
    <head>
      <base href="http://bugzilla.scilab.org/" />
    </head>
    <body><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> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - An GOOD compatibility bug :~))) Should be mentioned in Help/Doc Matlab (code"
   href="http://bugzilla.scilab.org/show_bug.cgi?id=6729">bug 6729</a>
                <br><br>
                ---------- Bug Summary ----------- <br>An GOOD compatibility bug :~))) Should be mentioned in Help/Doc Matlab (code <br><br>

          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">URL</td>
           <td>no error message
           </td>
           <td>
                
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Assignee</td>
           <td>vincent.couvert@scilab-enterprises.com
           </td>
           <td>bugzilla.admin@scilab.org
           </td>
         </tr></table>
      <p>
        <div>

            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - An GOOD compatibility bug :~))) Should be mentioned in Help/Doc Matlab (code"
   href="http://bugzilla.scilab.org/show_bug.cgi?id=6729#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - An 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>(In reply to Vincent COUVERT from <a href="show_bug.cgi?id=6729#c1">comment #1</a>)
<span class="quote">> I'm not sure it is an associativity problem:
> - First example: (int16(1)+0.4)+0.4 is equivalent to (int16(1)+int16(0.4))+int16(0.4) ==> (int16(1) + 0) + 0 ==> 1
> - Second example:  int16(1)+(0.4+0.4) is equivalent to int16(1)+int16(0.4+0.4) ==> int16(1) + int16(0.8) ==> 2</span >

Which version were you commenting: The Matlab or Scilab one?

In Octave 4.2.1, we still get:
<span class="quote">>(int16(1)+0.4)+0.4 returns 1, but
>int16(1)+(0.4+0.4) returns 2 (In Matlab addition is not associative!)</span >

The difference between Scilab and Octave is that Scilab int() decimal numbers when casting them into encoded integers:
--> int8(-1.2)
 ans  =
 -1

--> int8(1.2)
 ans  =
  1

While Octave rounds them:
<span class="quote">>> int8(-1.6)</span >
ans = -2
<span class="quote">>> int8(-1.5)</span >
ans = -2
<span class="quote">>> int8(-1.4999)</span >
ans = -1
<span class="quote">>> int8(1.4999)</span >
ans = 1
<span class="quote">>> int8(1.6)</span >
ans = 2

The status of Matlab versus Octave should be checked before fixing mtlb_int#() implementations</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>