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

instance method Integer#~

~ self -> Integer[permalink][rdoc]

ビット演算子。否定を計算します。


~1  # => -2
~3  # => -4
~-4 # => 3