문제

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!

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top