* Jonathan S. Shapiro:

>> The two floating point values have the IEEE representation
>> 3FEFFFFFFFFFFFFD and 3FEFFFFFFFFFFFFE.

> OK. Let's work the example. Please start by telling me which
> floating point values you are using, and which representation you
> are using when you give me these hex values.

These are double-precision IEEE binary floating-point values.  As it
is customary when writing down numbers, the most significant bit comes
first.

> Different hardware places the mantissa and sign in
> different positions, so what I'm asking is which bits of your hex
> representation are the exponent, sign, and mantissa.

1 sign bit, 11 bits exponent (using a biased encoding), and 52 bits of
mantissa, excluding the implicit leading one bit.

> Also, could you please stop complicating the exponents? Mixing bases
> and putting arithmetic in the exponents is just making things
> obfuscated.

That's due to the biased exponent encoding.

> Computations using rational numbers are irrelevant here - you have
> extra precision in the individual numbers, and this alters the
> results of the multiplications.

I don't see how you can show that some binary floating point number is
the closest approximation to a given decimal floating point number
(and thus the correct result of the conversion) without resorting to
rational arithmetic.

> I don't have time to re-derive the formal proof of correctness for
> precision. It's been done several times, and it's published in the
> literature. The bottom line is that if you require K bits of
> precision, and you have k+3 bits of precision (which my method
> *does* have), you have more than enough bits to round correctly, and
> that's all you need.

I think the problem is that you need 170-odds bits of precision just
to tell the inputs apart, not only 53 bits.

Michel Hack, "On Intermediate Precision Required for
Correctly-Rounding Decimal-to-Binary Floating-Point Conversion" gives
a recipe for constructing a much, much longer decimal input number.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to