Is there any way to change the rounding mode when doing operations with GMP? Or do I have to use MPFR for that?
Thanks in advance!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you should use MPFR if you want to control rounding.
The good news is it’s relatively trivial to initialize an mpfr_t from an mpf_t, so you can throw it in where you need the rounding control, if you don’t want to convert everything over.
See: http://www.mpfr.org/mpfr-current/mpfr.html