Ruby 1.8.7 Reference Manual > All Libraries > Builtin Library > class Fixnum > ~
~ -> Fixnum | Bignum
ビット演算子。否定を計算します。
~1 #=> -2 ~3 #=> -4 ~-4 #=> 3