Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

BigDecimal#+

self + value → bigdecimal

Returns the BigDecimal sum of self and value:

Example
b = BigDecimal('111111.111') # => 0.111111111e6
b + 2                        # => 0.111113111e6
b + 2.0                      # => 0.111113111e6
b + Rational(2, 1)           # => 0.111113111e6
b + Complex(2, 0)            # => (0.111113111e6+0i)

See the Note About Precision.

See also #** #+@ #* #- also in 3.3 · 3.1 · 3.0