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

Adjust modulus/remainder calculation for infinity arguments #187

Closed
jeremyevans opened this issue Mar 10, 2021 · 0 comments · Fixed by #243
Closed

Adjust modulus/remainder calculation for infinity arguments #187

jeremyevans opened this issue Mar 10, 2021 · 0 comments · Fixed by #243

Comments

@jeremyevans
Copy link
Contributor

require 'bigdecimal'
bd = BigDecimal("4.2")
bd.remainder(BigDecimal("+Infinity")) # => NaN, should be bd
bd.remainder(BigDecimal("-Infinity")) # => NaN, should be bd

See https://bugs.ruby-lang.org/issues/6120

I've submitted a pull request to ruby to fix the issue with Integer/Float, but bigdecimal should be handled separately.

mrzasa added a commit to mrzasa/bigdecimal that referenced this issue Nov 30, 2022
mrzasa added a commit to mrzasa/bigdecimal that referenced this issue Nov 30, 2022
mrzasa added a commit to mrzasa/bigdecimal that referenced this issue Nov 30, 2022
mrzasa added a commit to mrzasa/bigdecimal that referenced this issue Dec 16, 2022
mrzasa added a commit to mrzasa/bigdecimal that referenced this issue Dec 16, 2022
mrzasa added a commit to mrzasa/bigdecimal that referenced this issue Jan 13, 2023
mrzasa added a commit to mrzasa/bigdecimal that referenced this issue Jan 13, 2023
mrzasa added a commit to mrzasa/bigdecimal that referenced this issue Jan 13, 2023
@mrkn mrkn closed this as completed in #243 Feb 17, 2023
nobu added a commit to nobu/bigdecimal that referenced this issue Feb 21, 2023
ruby#187 has changed a behavior and ruby/spec also needed a
follow up at ruby/ruby@0d8ef62.
However, because bigdecimal is a separate gem and can be updated in
older versions of ruby, `RUBY_VERSION` is not appropriate for this
guard.  That means it needs bumped up `BigDecimal::VERSION`.
@nobu nobu mentioned this issue Feb 21, 2023
matzbot pushed a commit to ruby/ruby that referenced this issue Feb 21, 2023
ruby/bigdecimal#187 has changed a behavior and ruby/spec also needed a
follow up at 0d8ef62fc293.
However, because bigdecimal is a separate gem and can be updated in
older versions of ruby, `RUBY_VERSION` is not appropriate for this
guard.  That means it needs bumped up `BigDecimal::VERSION`.

ruby/bigdecimal@3a2a7a9353
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant