2011/3/23 James K Beard <[email protected]>: > You don't need to go to BCD to convert DFP to IEEE (regular) floating point. > A single arithmetic operation directly in DFP will exceed what you do to > convert to IEEE floating point. I would use double precision for anything > up to 12 decimals of accuracy, 80-bit for another three, and simply > incorporate the quad precision libraries with credit (or by reference, if > differences in licensing are a problem) for distribution. > > Anything other than binary representation will be less efficient in terms of > accuracy provided by a given number of bits. By illustration, base 10 > requires four bits, but provides only 3.32 bits (log2(10)) per digit of > accuracy. The only relief from this fundamental fact is use of less bits > for the exponent, and in IEEE floating point the size of the exponent field > is minimized just about to the point of diminishing returns (problems > requiring workaround in areas such as determinants, series and large > polynomials) to begin with. > > James K Beard
Well, DFP <-> IEEE conversion is already present in libgcc. So you shouldn't need here any special implementation. I would suggest that you are using for 32-bit and 64-bit DFP the double type, and AFAICS the 80-bit IEEE should be wide enough for the 128-bit DFP. How big is its exponent specified? Interesting might be the rounding. Regards, Kai ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
