Minimum floating-point requirements

Rich Felker dalias@aerifal.cx
Mon Feb 17 00:35:00 GMT 2014


On Sun, Feb 16, 2014 at 08:41:48PM -0300, Adhemerval Zanella wrote:
> I'd like to focus on practical side: you cited 'I make this complaint about IBM
> double-double as a floating point programmer who specifically has to work around
> its brokenness'. Do you have an empirical example where you had to circumvent the
> issues with IBM long double to make your code to work properly? I'm asking because
> I sincerely would like to know a real world case where IBM long double is causing
> issues.

I have not tested the code with IBM double-double, so I can't say for
sure that it breaks, but my strtod/f/ld implementation depends on
rounding semantics which I can't see how IBM double-double could
provide. For example it expects adding and subtracting an appropriate
power of two to be able to force rounding at a particular binary
place, per the current rounding mode. This is a standard idiom that
lots of floating point code attempting to get exact or
correctly-rounded results will perform. The reason for wanting to
perform it in long double is that smaller types are subject to excess
precision on i386 (and unlike IBM double-double, which is an
implementation choice, excess precision on i386 is not something you
can opt out of; it's inherent in the hardware).

I could probably find other examples if necessary.

Rich



More information about the Libc-alpha mailing list