Paolo,<br><br>The ones I found are fmax:<br><br>fmax<br> "The largest value allowed by the characterized<br> floating point object representation. The answer<br> should be equal to<br><br> (1 - (self radix raisedTo: self precision negated))
<br> * (self radix raisedTo: self emax + 1)<br><br> Note the ANSI spec says<br><br> (1 - (self radix raisedTo: self precision negated))<br> * (self radix raisedTo: self emax)<br><br> but this is not correct"
<br><br><br>and fminDenormalized<br><br>fminDenormalized<br> "The minimum denormalized value allowed by the<br> characterized floating point object representation.<br> The answer should be equal to<br><br> self radix raisedTo: self emin - self precision + 1
<br><br> Note the ANSI spec says<br><br> self radix raisedTo: self emin - self precision<br><br> but this is not correct"<br><br><br>I took a look at #precision, and I think in your case #epsilon fails because Double>>precision is 52 and Float>>precision is 23. However, both of those can use an implicit bit in the mantissa, and thus (unless they're denormalized) they actually use 53 and 24 significant bits, respectively. 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 <<a href="mailto:paolo.bonzini@lu.unisi.ch">paolo.bonzini@lu.unisi.ch</a>> 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>> I replied from my home account and thus I think the message went to the<br>> bit bucket... but I meant to say this is fantastic. I added an item to<br>> the meta, and also created the errata page mentioning two off by one
<br>> problems in the float protocol.<br><br></div>Could you be more specific? I only knew of the one in #epsilon.<br><br>st> 2.0d timesTwoPower: 1 - FloatD precision "ANSI definition"<br>0.0000000000000004440892098500627
<br>st> FloatD epsilon "dividing by two..."<br>0.0000000000000002220446049250313<br>st> (1.0d + FloatD epsilon) = 1.0d "...is still ok"<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>