bigdecimal icon indicating copy to clipboard operation
bigdecimal copied to clipboard

Adjust modulus/remainder calculation for infinity arguments

Open jeremyevans opened this issue 4 years ago • 0 comments

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.

jeremyevans avatar Mar 10 '21 22:03 jeremyevans