Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. 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.2 · 3.1 · 3.0