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

fix using big rational #**with unsigned ints #10887

Merged
merged 5 commits into from
Jul 5, 2021

Conversation

stakach
Copy link
Contributor

@stakach stakach commented Jul 2, 2021

the compiler complains that -other is not possible when passing an unsigned value to the function

    if other < 0
      return (self ** -other).inv
    end

stakach and others added 2 commits July 3, 2021 10:00
Co-authored-by: George Dietrich <george@dietrich.app>
@straight-shoota
Copy link
Member

I think this could be fixed simply by replacing -other with other.abs. That's done in other places as well. No need for an extra overload.

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:numeric labels Jul 3, 2021
@straight-shoota straight-shoota added this to the 1.1.0 milestone Jul 3, 2021
@straight-shoota straight-shoota merged commit da3c381 into crystal-lang:master Jul 5, 2021
@straight-shoota
Copy link
Member

Thank you @stakach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:numeric
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants