Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

BigDecimal#-@

-self → bigdecimal

Returns the BigDecimal negation of self:

Example
b0 = BigDecimal('1.5')
b1 = -b0 # => -0.15e1
b2 = -b1 # => 0.15e1
See also #- #/ #+@ #< also in 3.2 · 3.1 · 3.0