Sha256: 21aa8ee2bdce4c2de269ed9efb3a5ef892662ad28f83c75018cc36c5e4070269
Contents?: true
Size: 758 Bytes
Versions: 83
Compression:
Stored size: 758 Bytes
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' describe "Numeric#-@" do it " should return the same value with opposite sign (integers)" do 0.send(:-@).should == 0 100.send(:-@).should == -100 -100.send(:-@).should == 100 end it " should return the same value with opposite sign (floats)" do 34.56.send(:-@).should == -34.56 -34.56.send(:-@).should == 34.56 end it " should return the same value with opposite sign (two complement)" do 2147483648.send(:-@).should == -2147483648 -2147483648.send(:-@).should == 2147483648 9223372036854775808.send(:-@).should == -9223372036854775808 -9223372036854775808.send(:-@).should == 9223372036854775808 end end
Version data entries
83 entries across 83 versions & 1 rubygems