It may not be as bad as you might think because trigonometric functions become invalid for arguments with magnitude defined by the mantissa length, not the exponent, and the exponent is removed as part of the process in log and exponentiation operations.
James K Beard -----Original Message----- From: Jon [mailto:[email protected]] On Behalf Of JonY Sent: Wednesday, March 23, 2011 9:20 PM To: Kai Tietz Cc: [email protected]; [email protected]; James K Beard Subject: Re: [Mingw-w64-public] mingw-w64 Decimal Floating Point math -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 3/24/2011 02:29, Kai Tietz wrote: > 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 > Long doubles extended precision go up to 4963 (base 10) in exponent, while DECIMAL128 go up 6144, this is assuming I didn't get the docs wrong. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (MingW32) iEYEARECAAYFAk2KnFEACgkQp56AKe10wHf30ACeKpD4YvTTR8k8pSO9njpa9pVQ /B8An1s6P6yNV1UcTdIe6evB6VrVz9IV =hBNq -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ 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
