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

Exact Rational Values #37

Closed
rickyefarr opened this issue Feb 8, 2015 · 1 comment
Closed

Exact Rational Values #37

rickyefarr opened this issue Feb 8, 2015 · 1 comment

Comments

@rickyefarr
Copy link
Contributor

If one desires to set arb_t variable to be an integer, a precision is not required to do so. On the other hand, in order for a user to set an arb_t variable to be rational, one must specify a precision.

Would it be better to allow rational numbers to be stored exactly?

@fredrik-johansson
Copy link
Collaborator

This only works for integers because integers are a subset of floating-point numbers. Doing it with rationals would require a union type. I'm not sure if this would be worth the effort to implement at the moment, considering that there are workarounds.

Where it's beneficial to preserve exact rationals, I've generally just made two versions of a function: one that takes an fmpq_t argument and one that takes an arb_t.

In some other places, I've allowed the input p / q to be passed as two separate arb_t variables, doing arithmetic with numerators and denominators separated.

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