This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: IEEE128 binary float to decimal float conversion routines


On Mon, 16 Nov 2015, Paul E. Murphy wrote:

> Thanks for pointing that out. libgcc implements a subset
> of the API provided by libdfp. However, libdfp should have
> better compliance and optimization for powerpc targets. They
> take different approaches when converting formats, among other
> things.

Thanks for the explanation.

I don't know my way around libdfp, so may be looking at the wrong source 
files that aren't actually used in practice.  But it's not apparent to me 
that e.g. base-math/trunctdsf.c would be correctly rounding; even if the 
conversion to double were exact, _Decimal128 has enough precision that I'd 
expect you to get double values exactly half way between two floats (but 
not exactly equal to the original decimal value) with incorrect results 
following from double rounding.  (And hardcoding infinity and zero as 
overflow and underflow results is obviously wrong in non-default rounding 
modes.)

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]