Ruby 2.7.0 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Integerクラス > -@

instance method Integer#-@

- self -> Integer[permalink][rdoc]

単項演算子の - です。 self の符号を反転させたものを返します。


- 10   # => -10
- -10  # => 10