Paolo,<br><br>The ones I found are fmax:<br><br>fmax<br>&nbsp;&nbsp;&nbsp; &quot;The largest value allowed by the characterized<br>&nbsp;&nbsp;&nbsp; floating point object representation.&nbsp; The answer<br>&nbsp;&nbsp;&nbsp; should be equal to<br><br>&nbsp;&nbsp;&nbsp; (1 - (self radix raisedTo: self precision negated))
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; * (self radix raisedTo: self emax + 1)<br><br>&nbsp;&nbsp;&nbsp; Note the ANSI spec says<br><br>&nbsp;&nbsp;&nbsp; (1 - (self radix raisedTo: self precision negated))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; * (self radix raisedTo: self emax)<br><br>&nbsp;&nbsp;&nbsp; but this is not correct&quot;
<br><br><br>and fminDenormalized<br><br>fminDenormalized<br>&nbsp;&nbsp;&nbsp; &quot;The minimum denormalized value allowed by the<br>&nbsp;&nbsp;&nbsp; characterized floating point object representation.<br>&nbsp;&nbsp;&nbsp; The answer should be equal to<br><br>&nbsp;&nbsp;&nbsp; self radix raisedTo: self emin - self precision + 1
<br><br>&nbsp;&nbsp;&nbsp; Note the ANSI spec says<br><br>&nbsp;&nbsp;&nbsp; self radix raisedTo: self emin - self precision<br><br>&nbsp;&nbsp;&nbsp; but this is not correct&quot;<br><br><br>I took a look at #precision, and I think in your case #epsilon fails because Double&gt;&gt;precision is 52 and Float&gt;&gt;precision is 23.&nbsp; However, both of those can use an implicit bit in the mantissa, and thus (unless they&#39;re denormalized) they actually use 53 and 24 significant bits, respectively.&nbsp; If precision is implemented like that, then it seems to me that epsilon should work.
<br><br>Thanks,<br>Andres.<br><br><br><div class="gmail_quote">On Nov 13, 2007 1:08 AM, Paolo Bonzini &lt;<a href="mailto:paolo.bonzini@lu.unisi.ch">paolo.bonzini@lu.unisi.ch</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Andres Valloud wrote:<br>&gt; I replied from my home account and thus I think the message went to the<br>&gt; bit bucket... but I meant to say this is fantastic. &nbsp;I added an item to<br>&gt; the meta, and also created the errata page mentioning two off by one
<br>&gt; problems in the float protocol.<br><br></div>Could you be more specific? &nbsp;I only knew of the one in #epsilon.<br><br>st&gt; 2.0d timesTwoPower: 1 - FloatD precision &nbsp;&quot;ANSI definition&quot;<br>0.0000000000000004440892098500627
<br>st&gt; FloatD epsilon &nbsp; &nbsp;&quot;dividing by two...&quot;<br>0.0000000000000002220446049250313<br>st&gt; (1.0d + FloatD epsilon) = 1.0d &nbsp; &nbsp;&quot;...is still ok&quot;<br>false<br><font color="#888888"><br>Paolo<br></font>
<div><div></div><div class="Wj3C7c"><br>_______________________________________________<br>ANSI-Smalltalk mailing list<br><a href="mailto:ANSI-Smalltalk@lists.openskills.org">ANSI-Smalltalk@lists.openskills.org</a><br><a href="http://lists.openskills.org/cgi-bin/mailman/listinfo/ansi-smalltalk" target="_blank">
http://lists.openskills.org/cgi-bin/mailman/listinfo/ansi-smalltalk</a><br></div></div></blockquote></div><br>