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

Undefined method '%' for BigDecimal #9782

Closed
ghost opened this issue Sep 30, 2020 · 5 comments · Fixed by #13255
Closed

Undefined method '%' for BigDecimal #9782

ghost opened this issue Sep 30, 2020 · 5 comments · Fixed by #13255
Labels
help wanted This issue is generally accepted and needs someone to pick it up kind:feature topic:stdlib:numeric

Comments

@ghost
Copy link

ghost commented Sep 30, 2020

The BigDecimal class, in big/big_decimal.cr, has no % method, making it impossible to modulo a BigDecimal. This can be seen in this code:

require "big/big_decimal.cr"

a = BigDecimal.new 5
puts a % 2

Expected output: 1
Actual output: Error: undefined method % for BigDecimal
This can be seen on Carcin.

@asterite asterite added the help wanted This issue is generally accepted and needs someone to pick it up label Sep 30, 2020
@asterite
Copy link
Member

Thanks!

Unfortunately none of the core team members wrote BigDecimal so I don't understand how the code works to fix it.

@ghost
Copy link
Author

ghost commented Sep 30, 2020

Ok, good to know. With Hacktoberfest starting tomorrow I might try and look at the code and see if I can fix it myself and PR.

@ghost
Copy link
Author

ghost commented Oct 1, 2020

Should be fixed by #9784.

@ghost ghost closed this as completed Oct 1, 2020
@asterite asterite reopened this Oct 2, 2020
@asterite
Copy link
Member

asterite commented Oct 2, 2020

Issues are automatically closed when PRs merge

@BrucePerens
Copy link

Thanks for filing and fixing, I hit this one too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted This issue is generally accepted and needs someone to pick it up kind:feature topic:stdlib:numeric
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants