Skip to content

Commit

Permalink
test big rational
Browse files Browse the repository at this point in the history
  • Loading branch information
ahorek authored and eregon committed Jan 11, 2020
1 parent 6102b74 commit 84d606a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions language/numbers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
eval('-3r').should == Rational(-3, 1)
end

it "can be a float literal with trailing 'r' to represent a Rational" do
eval('0.0174532925199432957r').should == Rational(174532925199432957, 10000000000000000000)
end

it "can be an bignum literal with trailing 'r' to represent a Rational" do
eval('1111111111111111111111111111111111111111111111r').should == Rational(1111111111111111111111111111111111111111111111, 1)
eval('-1111111111111111111111111111111111111111111111r').should == Rational(-1111111111111111111111111111111111111111111111, 1)
Expand Down

0 comments on commit 84d606a

Please sign in to comment.