diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-21 01:16:26 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-21 01:19:55 +0900 |
commit | 9c73c756244fa27ffa99d81dcc73a4ad14198002 (patch) | |
tree | 14b0ea9059b8c31e276531a1df712ead4e158cdb /spec/ruby/library/bigdecimal | |
parent | fb8f011422c645ebe29e94c3fb2079af73d1d35f (diff) |
Use Integer instead of Fixnum/Bignum
Diffstat (limited to 'spec/ruby/library/bigdecimal')
-rw-r--r-- | spec/ruby/library/bigdecimal/add_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/library/bigdecimal/exponent_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/bigdecimal/shared/to_int.rb | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/spec/ruby/library/bigdecimal/add_spec.rb b/spec/ruby/library/bigdecimal/add_spec.rb index bea8b8f764..f844ca96fa 100644 --- a/spec/ruby/library/bigdecimal/add_spec.rb +++ b/spec/ruby/library/bigdecimal/add_spec.rb @@ -41,14 +41,14 @@ describe "BigDecimal#add" do @frac_3.add(@frac_4, 6).should == BigDecimal("0.11111E16") end - it "returns a + [Fixnum value] with given precision" do + it "returns a + [Integer value] with given precision" do (1..10).each {|precision| @dot_ones.add(0, precision).should == BigDecimal("0." + "1" * precision) } BigDecimal("0.88").add(0, 1).should == BigDecimal("0.9") end - it "returns a + [Bignum value] with given precision" do + it "returns a + [Integer value] with given precision" do bignum = 10000000000000000000 (1..20).each {|precision| @dot_ones.add(bignum, precision).should == BigDecimal("0.1E20") diff --git a/spec/ruby/library/bigdecimal/exponent_spec.rb b/spec/ruby/library/bigdecimal/exponent_spec.rb index a349ac093f..f63c4e5798 100644 --- a/spec/ruby/library/bigdecimal/exponent_spec.rb +++ b/spec/ruby/library/bigdecimal/exponent_spec.rb @@ -22,7 +22,7 @@ describe "BigDecimal#exponent" do =begin platform_is wordsize: 32 do # TODO: write specs for both 32 and 64 bit - it "returns 0 if exponent can't be represented as Fixnum" do + it "returns 0 if exponent can't be represented as Integer" do BigDecimal("2E1000000000000000").exponent.should == 0 BigDecimal("-5E-999999999999999").exponent.should == 0 end diff --git a/spec/ruby/library/bigdecimal/shared/to_int.rb b/spec/ruby/library/bigdecimal/shared/to_int.rb index 02f6092f23..41dd200b9f 100644 --- a/spec/ruby/library/bigdecimal/shared/to_int.rb +++ b/spec/ruby/library/bigdecimal/shared/to_int.rb @@ -6,7 +6,7 @@ describe :bigdecimal_to_int , shared: true do -> { BigDecimal("NaN").send(@method) }.should raise_error(FloatDomainError) end - it "returns Integer or Bignum otherwise" do + it "returns Integer or Integer otherwise" do BigDecimal("3E-20001").send(@method).should == 0 BigDecimal("2E4000").send(@method).should == 2 * 10 ** 4000 BigDecimal("2").send(@method).should == 2 |