<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><font face="Arial">Dear co-Scilabers,</font></p>
    <p>I met a strange Scilab's bug this week-end. But today, i tried
      with Octave, Matlab2016 and R, and i found the same strange
      behavior. So, either i am missing something, or the bug affects
      all these languages in the same way. It is reported @
      <a class="moz-txt-link-freetext" href="http://bugzilla.scilab.org/15276">http://bugzilla.scilab.org/15276</a><br>
    </p>
    <p>In a few words, here it is:</p>
    <p>The mantissa of any decimal number is recorded on 53 bits
      (numbered #0 to #52) + 1 bit for the sign.<br>
      This relative absolute accuracy sets the value of the
      epsilon-machine :<br>
      <tt>--> %eps == 2^0 / 2^52</tt><tt><br>
      </tt><tt> ans  =</tt><tt><br>
      </tt><tt>  T</tt><br>
      From here, it comes, as expected:</p>
    <p><tt>--> 2^52 + 1 == 2^52</tt><tt><br>
      </tt><tt> ans  =</tt><tt><br>
      </tt><tt>  F</tt><tt><br>
      </tt><tt><br>
      </tt><tt>--> 2^53 - 1 == 2^53<br>
        Â ans  =<br>
        Â  F<br>
        <br>
        --> 2^53 + 1 == 2^53</tt><tt>   // (A)<br>
      </tt><tt> ans  =</tt><tt><br>
      </tt><tt>  T</tt><tt><br>
      </tt><br>
      Now comes the issue:<br>
      In (A), the relative difference 1/2^53 is too small (< %eps) to
      be recorded and to change the number. OK.<br>
      Since 1 / (2^53 +2) is even smaller than 1 / (2^53), it should nor
      make a difference. Yet, it does:</p>
    <p><tt>--> (2^53 + 2^1) + 1 == (2^53 + 2^1)</tt><tt><br>
      </tt><tt> ans  =</tt><tt><br>
      </tt><tt>  F</tt><tt><br>
      </tt><br>
      How is this possible ??!<br>
      But this occurs only when THIS bit #0 is set. For higher bits
      (hebelow the #1 one), we get back to the expected behavior:<br>
      <tt>--> (2^53 + 2^2) + 1 == (2^53 + 2^2)</tt><tt><br>
      </tt><tt> ans  =</tt><tt><br>
      </tt><tt>  T</tt><tt><br>
      </tt><br>
      So, when the bit #0 is set and we add a value on the bit "#-1",
      the language somewhat behaves as if there was a "withholding"
      value on the bit #0, and seems to toogle it.<br>
      Is is a part of any IEEE floating point convention, or am i
      missing anything, or is it a true bug?<br>
      Again, R, Octave and Matlab behave exactly in the same way...</p>
    <span id="result_box" class="short_text" lang="en"><span class="">Looking
        forward to reading your thoughts,<br>
        <br>
      </span></span>Samuel<br>
    <br>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
  </body>
</html>