Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions core/float/ceil_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@
-9223372036854775808.1.ceil.should eql(-9223372036854775808)
+9223372036854775808.1.ceil.should eql(+9223372036854775808)
end

ruby_version_is "2.4" do
it "returns the smallest number greater than or equal to self with an optionally given precision" do
2.1679.ceil(0).should eql(3)
214.94.ceil(-1).should eql(220)
7.0.ceil(1).should eql(7.0)
-1.234.ceil(2).should eql(-1.23)
5.123812.ceil(4).should eql(5.1239)
end
end
end
10 changes: 10 additions & 0 deletions core/float/floor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@
-9223372036854775808.1.floor.should eql(-9223372036854775808)
+9223372036854775808.1.floor.should eql(+9223372036854775808)
end

ruby_version_is "2.4" do
it "returns the largest number less than or equal to self with an optionally given precision" do
2.1679.floor(0).should eql(2)
214.94.floor(-1).should eql(210)
7.0.floor(1).should eql(7.0)
-1.234.floor(2).should eql(-1.24)
5.123812.floor(4).should eql(5.1238)
end
end
end
10 changes: 10 additions & 0 deletions core/float/truncate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,14 @@

describe "Float#truncate" do
it_behaves_like(:float_to_i, :truncate)

ruby_version_is "2.4" do
it "returns self truncated to an optionally given precision" do
2.1679.truncate(0).should eql(2)
7.1.truncate(1).should eql(7.1)
214.94.truncate(-1).should eql(210)
-1.234.truncate(2).should eql(-1.23)
5.123812.truncate(4).should eql(5.1238)
end
end
end