That epsilon will fit in quad precision. James K Beard
-----Original Message----- From: Jon [mailto:[email protected]] On Behalf Of JonY Sent: Saturday, April 09, 2011 9:07 PM To: [email protected]; [email protected] Cc: James K Beard Subject: Re: [Mingw-w64-public] mingw-w64 Decimal Floating Point math -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 4/10/2011 01:54, James K Beard wrote: > I think the long term solution is to implement the decimal arithmetic > keywords with an open mind. Special requirements, like extremely long > decimal words (DECIMAL128 == 128 digits?????) may require > multiple-precision arithmetic, which may be problematic because most > compilers support up to quad precision floating point, which is 128 > bits with 12 bits exponent and > 116 bits mantissa, or about 35 decimal digits. > DECIMAL128 has an epsilon of 1E-33DL, I guess that means the first 33 digits after the decimal point has to be free from rounding errors. > If financial calculations were all that was required, that would be > enough for practical use, because overflow would be at 10^33 > dollars/yen/pesos/yuan/whatever. Nothing in real-world finance > requires more dynamic range. > > But, nothing in nature requires more than about 10^125, which is the > ratio of the densities of intergalactic space and the interior of a > neutron star, or the time in years for the universe to reach total > heat death and an overall homogeneous thermal composition. That's why > IEEE floating points overflow at 10^38 or, for more than 32 bits, 10^308. > > I have a multiple precision package that I use for personal work that, > for software convenience and best speed, uses a signed 16-bit integer > for the exponent and overflows at 10^9863. I've been thinking about > releasing it under the GPL but there is a lot of code cleanup needed, > and some core modules are from Numerical Recipes for Fortran 90 and > will require another license that I haven't pursued. > > James K Beard > I've talked with Kai sometime ago about licensing, GPL and LGPL aren't practical for mingw-w64, if it were, I would have taken libdecnumber and libquadmath from gcc directly. He opted for a MIT or BSD type license so mingw-w64 could still be used to develop proprietary software. I did find one with BSD license, nice decimal float support too, but its build system is so horrendous that it takes more work to fix it than actual programming. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (MingW32) iEYEARECAAYFAk2hAq0ACgkQp56AKe10wHeFZgCfQmo3NY64k/xltDCjK438gkDj 0UAAnAk42s3/1BuA24FfGal6kbncF8uF =H47M -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
