Paolo,<br><br>Yes, the implementation here uses 1023 and -1022.&nbsp; Hmmmm... I am not sure about emax / emin being off by one though.&nbsp; If the range goes from 0 to 2047, and 0 and 2047 are taken, then that takes one off from each side, and 1024 / -1021 do not balance out that way?...
<br><br>Andres.<br><br><div class="gmail_quote">On Nov 13, 2007 11:49 PM, 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;">
&gt; fmax<br><div class="Ih2E3d">&gt; &nbsp; &nbsp; (1 - (self radix raisedTo: self precision negated))<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; * (self radix raisedTo: self emax + 1)<br>&gt;<br>&gt; &nbsp; &nbsp; Note the ANSI spec says<br>&gt;<br>&gt; &nbsp; &nbsp; (1 - (self radix raisedTo: self precision negated))
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; * (self radix raisedTo: self emax)<br>&gt;<br></div>&gt; fminDenormalized<br><div class="Ih2E3d">&gt; &nbsp; &nbsp; self radix raisedTo: self emin - self precision + 1<br>&gt;<br>&gt; &nbsp; &nbsp; Note the ANSI spec says<br>
&gt;<br>&gt; &nbsp; &nbsp; self radix raisedTo: self emin - self precision<br><br></div>I think you also have emin and emax off by one. :-) &nbsp;The exponent field<br>goes from 1 to 2046 for Doubles, since 0 is reserved for zero/denormals
<br>and 2047 for infinities/NaNs.<br><br>Since the mantissa in LIA-1 is &lt; 1, emax is 1024 and emin is -1021. &nbsp;You<br>probably are using 1023 and -1022.<br><br>Then, if you put precision = 52 in this you do get an off-by-one error,
<br>which convinces me more that, as you said, the right value of precision<br>should include the implicit 1. &nbsp;So, no errata in &lt;FloatCharacterization&gt;<br>right?<br><div><div></div><div class="Wj3C7c"><br>Paolo<br><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>