Converting rationals, long double and integers
edA-qa mort-ora-y
eda-qa at disemia.com
Wed Mar 13 05:29:52 CET 2013
On 12/03/13 20:34, Marc Glisse wrote:
> If the exponent doesn't overflow, you can convert to a double, subtract
> that double (converted to mpq or mpf), convert what remains to double,
> etc. You can then convert those 2 or 3 double to long double and sum them.
Thank you, that seems like it should work. I was concerned about the
rounding of the first double, but if I subtract it from the
high-precision value again any rounding error will be restored in the
second double. I'll have to think of a way to do higher exponents.
Do you know if inclusion of long long or long double is something coming
to GMP?
--
edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://gmplib.org/list-archives/gmp-discuss/attachments/20130313/3131abbe/attachment.bin>
More information about the gmp-discuss
mailing list