Skip to content

Instantly share code, notes, and snippets.

@bradediger
Created February 11, 2009 15:26
Show Gist options
  • Save bradediger/62061 to your computer and use it in GitHub Desktop.
Save bradediger/62061 to your computer and use it in GitHub Desktop.
>> RUBY_VERSION
=> "1.9.1"
>> Rational(Rational(1,2),Rational(3,4)).inspect
=> "(2/3)"
>> RUBY_VERSION
=> "1.8.6"
>> Rational(Rational(1,2),Rational(3,4)).inspect
NoMethodError: undefined method `gcd' for Rational(1, 2):Rational
from /usr/local/lib/ruby/1.8/rational.rb:78:in `reduce'
from /usr/local/lib/ruby/1.8/rational.rb:35:in `Rational'
from (irb):2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment