summaryrefslogtreecommitdiff
path: root/spec/ruby/core/bignum/complement_spec.rb
blob: be6bc21b19e49742d8ed5e7a663e97ed5b93fb7c (plain)
1
2
3
4
5
6
7
8
9
require File.expand_path('../../../spec_helper', __FILE__)

describe "Bignum#~" do
  it "returns self with each bit flipped" do
    (~bignum_value(48)).should == -9223372036854775857
    (~(-bignum_value(21))).should == 9223372036854775828
    (~bignum_value(1)).should == -9223372036854775810
  end
end