Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is there a mpf_set_z function but not mpf_get_z function? #267

Open
SanderBouwhuis opened this issue Feb 6, 2019 · 4 comments
Open

Comments

@SanderBouwhuis
Copy link

SanderBouwhuis commented Feb 6, 2019

I would like to be able to convert from mpz_t to mpf_t and back. How do I do that?

MPZ_T to MPF_T : mpf_set_z (WORKS)
MPF_T to MPZ_T : ?mpz_set_f? (DOESN'T WORK)

Why is there a mpf_set_z function but not mpz_get_f function?

Alternatively, why are there no mpf_get_z and mpz_get_f functions?

I guess I could convert the int/float to a string and then convert it to float/int, but that just seems ridiculously bad for performance.

@wbhart
Copy link
Owner

wbhart commented Feb 6, 2019

The development of the mpf interface was discontinued due to the development of the MPFR package:

https://www.mpfr.org/

We recommend you use that instead. There is no value in duplicating their effort in the MPIR project.

@SanderBouwhuis
Copy link
Author

I use MPIR from Brian Gladman because it works on Windows. MPFR doesn't seem to work on Windows (out of the box)?

Are there bugs in mpf_t? Should I be worried?

@wbhart
Copy link
Owner

wbhart commented Feb 6, 2019

I'm not aware of bugs, but it is very slow compared to MPFR.

Brian Gladman also supports MPFR on Windows.

@SanderBouwhuis
Copy link
Author

Aha, ok. Quite unfortunate that it's yet another thing that requires effort compiling/integrating and such. I think for now I'll have to stick with MPIR because of time constraints.

Thanks for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants