[ANSI-Smalltalk] Agenda items...
Paolo Bonzini
paolo.bonzini at lu.unisi.ch
Wed Nov 14 07:49:20 GMT 2007
> fmax
> (1 - (self radix raisedTo: self precision negated))
> * (self radix raisedTo: self emax + 1)
>
> Note the ANSI spec says
>
> (1 - (self radix raisedTo: self precision negated))
> * (self radix raisedTo: self emax)
>
> fminDenormalized
> self radix raisedTo: self emin - self precision + 1
>
> Note the ANSI spec says
>
> self radix raisedTo: self emin - self precision
I think you also have emin and emax off by one. :-) The exponent field
goes from 1 to 2046 for Doubles, since 0 is reserved for zero/denormals
and 2047 for infinities/NaNs.
Since the mantissa in LIA-1 is < 1, emax is 1024 and emin is -1021. You
probably are using 1023 and -1022.
Then, if you put precision = 52 in this you do get an off-by-one error,
which convinces me more that, as you said, the right value of precision
should include the implicit 1. So, no errata in <FloatCharacterization>
right?
Paolo
More information about the ANSI-Smalltalk
mailing list