<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Thanks a lot Bruno!</p>
<p>I knew I had read something like that but could not remember what
it was called.</p>
<p>Cheers,</p>
<p>Antoine</p>
<p>PS: Samuel, do you think you could close the bug by pointing to
this "round to even" rule?<br>
</p>
<br>
<div class="moz-cite-prefix">Le 19/09/2017 à 11:16, Pinçon Bruno a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:07f17707-c57d-50fa-d6fe-ba7196278fea@univ-lorraine.fr">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div class="moz-cite-prefix">Le 18/09/2017 à 20:54, Samuel Gougeon
a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:03a6b389-083a-0dad-b6ab-b8a9a29ecf44@free.fr">
<meta http-equiv="content-type" content="text/html;
charset=utf-8">
<br>
<p> 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 ??!</p>
</blockquote>
<br>
<font size="+1"> <tt> </tt><tt>Hi all, </tt><tt><br>
</tt><tt><br>
</tt><tt> no issue here but</tt> <tt>s</tt><tt>imply the
round to even rule. Every real number<br>
should be approximated by the nearest floating point number
but in case of<br>
a number exactly between 2 successive floats the one with an
even end<br>
digit win. You can see this rule as a mean to approximate
those ambiguous cases,<br>
one in two down and one in two up, but has more subtle
features in it such<br>
(it is explained in Knuth I). <br>
<br>
<br>
OK that</tt><tt> </tt></font><tt><font size="+1">2^53 + 2^1
is exactly represented<br>
(it is a double float number). When computing : <br>
<br>
</font></tt><tt><tt> x = (2^53 + 2^1) + 1<br>
<br>
it is not a float but is exactly at the same distance
between the two floats :<br>
<br>
</tt></tt><tt><tt>2^53 + 2^1 and </tt></tt><tt><tt>2^53
+ 2^2 but this last one ends with a even digit (0)<br>
so : </tt></tt><br>
<tt><tt><tt><tt> fl( (2^53 + 2^1) + 1) = </tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>2^53
+ 2^2<br>
<br>
hth<br>
Bruno<br>
<br>
</tt></tt></tt></tt></tt></tt> <br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>