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

Negative and floating-point periods #5

Open
wuhkuh opened this issue Sep 3, 2017 · 0 comments
Open

Negative and floating-point periods #5

wuhkuh opened this issue Sep 3, 2017 · 0 comments

Comments

@wuhkuh
Copy link
Owner

wuhkuh commented Sep 3, 2017

Problem:
A BadPeriodError is raised (or the corresponding tuple returned) when the period is 0, but not when the period is negative or even a floating-point number.

When porting to C, this could lead to unwanted behavior when typecasting floats to integers. However, I'm not sure how the GMP library handles this case.

It should be resolved nevertheless; from a user's perspective this is unwanted behavior.

Solution:
Periods should come in the form of a non-zero unsigned integer. Anything else should raise a BadPeriodError, or return {:error, :bad_period}.

@wuhkuh wuhkuh added this to the 0.1.0 milestone Sep 3, 2017
@wuhkuh wuhkuh self-assigned this Sep 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant