[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: flonum precision
On Mon, 1 Aug 2005, Aubrey Jaffer wrote:
>With the range of number representations we have been discussing, some
>of "6.2.3 Implementation restrictions" is seeming poorly specified:
> If, however, an exact number is operated upon so as to produce an
> inexact result (as by `sqrt'), and if the result is represented as a
> flonum, then the most precise flonum format available must be used;
> but if the result is represented in some other way then the
> representation must have at least as much precision as the most
> precise flonum format available.
>The second half is a strong statement; why are flonums specifically
>called out in the first half?
>And specifically which representations are "flonums"?
I think the usual interpretation of the word "flonum"
is the set of binary encodings recognized by the CPU
and/or native C compiler as floating-point encodings.
The usual interpretation of the "most precise" requirement
is that the most precise representation recognized by the
CPU or C environment native to that machine establishes the
minimum required precision for an implementation of inexact
numbers in a scheme on that machine. And for most of us,
that means the "double extended" 12-byte precision for
floating point numbers.
> The only definition R5RS gives for flonums is "Machine representations
> such as fixed point and floating point are referred to by names such
> as fixnum and flonum."
> Would floating-point numbers with latent explicit precision be
Probably not; they aren't a "machine representation" in the sense
intended by that sentence.
> Such a representation may well support arbitrary precision; in which
> case the term "most precise flonum format available" is not
> well-defined for the implementation.
Exactly. We interpret the meaning of the words in the standard
so that they express things which are meaningful, so we have to
rule that "flonum format" doesn't mean bigfloats of any kind.