Florian:

Base conversion is definitely complicated, but I'm pretty sure you have
your conversions wrong below. First, your output values don't match what C#
is getting, so can you say how you produced them?

Second, a 64-bit single-precision unsigned integer has far more precision
than a 64-bit double precision float. Yes, the possibility of round-up has
to be considered.

I'm about to head out on a trip, but I'll check what you say at some point
in the next few days.


On Sun, Aug 11, 2013 at 7:14 AM, Florian Weimer <[email protected]> wrote:

> * Jonathan S. Shapiro:
>
> > But there is a simpler way that I have never seen documented:
> >
> >    1. Convert the entire significand to a 64-bit unsigned integer,
> keeping
> >    track of where the decimal point was found but otherwise ignoring it,
> as if
> >    the significand was an integer-valued literal having no decimal
> point. Take
> >    care to stop if the integer result would overflow. In the event of
> >    overflow, the integer value *before* the overflowing computation
> >    contains all of the needed significant digits for the final floating
> point
> >    value.
>
> This is not true.
>
> 0.999999999999999722444243843710864894092082977294921875 =>
> 0.9999999999999998
> 0.99999999999999972244424384371086489409208297729492187 =>
> 0.9999999999999997
>
> Base conversion is complicated.
> _______________________________________________
> bitc-dev mailing list
> [email protected]
> http://www.coyotos.org/mailman/listinfo/bitc-dev
>
>
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to