Confusing docs . . . how do I use gcd2?

The standard library docs don't make sense to me a lot of the time.
How do I use the gcd2 method in class Integer (or is it in file
mathn.rb . . . no idea)?

Here's a link to what I'm looking at:
http://www.ruby-doc.org/stdlib/libdoc/mathn/rdoc/classes/Integer.html#M000926

···

On Jan 9, 8:32 pm, Matt <mgregor...@gmail.com> wrote:

The standard library docs don't make sense to me a lot of the time.
How do I use the gcd2 method in class Integer (or is it in file
mathn.rb . . . no idea)?

Matt wrote:

···

On Jan 9, 8:32 pm, Matt <mgregor...@gmail.com> wrote:

The standard library docs don't make sense to me a lot of the time.
How do I use the gcd2 method in class Integer (or is it in file
mathn.rb . . . no idea)?

Here's a link to what I'm looking at:
http://www.ruby-doc.org/stdlib/libdoc/mathn/rdoc/classes/Integer.html#M000926

Are you using 1.8.x or 1.9.x? The method is defined in mathn.rb for 1.8 but not for 1.9.

Matt wrote:

  

The standard library docs don't make sense to me a lot of the time.
How do I use the gcd2 method in class Integer (or is it in file
mathn.rb . . . no idea)?
    
Here's a link to what I'm looking at:
http://www.ruby-doc.org/stdlib/libdoc/mathn/rdoc/classes/Integer.html#M000926

Both, sort of.

ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]

irb(main):001:0> require 'mathn'
=> true
irb(main):002:0> 12.gcd(4)
=> 4

-Justin

···

On Jan 9, 8:32 pm, Matt <mgregor...@gmail.com> wrote:

Justin Collins wrote:

Matt wrote:

The standard library docs don't make sense to me a lot of the time.
How do I use the gcd2 method in class Integer (or is it in file
mathn.rb . . . no idea)?
    
Here's a link to what I'm looking at:
http://www.ruby-doc.org/stdlib/libdoc/mathn/rdoc/classes/Integer.html#M000926

Both, sort of.

ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]

irb(main):001:0> require 'mathn'
=> true
irb(main):002:0> 12.gcd(4)
=> 4

-Justin

Sorry, that should be gcd2.

-Justin

···

On Jan 9, 8:32 pm, Matt <mgregor...@gmail.com> wrote:

Justin Collins wrote:

Justin Collins wrote:

Matt wrote:

The standard library docs don't make sense to me a lot of the time.
How do I use the gcd2 method in class Integer (or is it in file
mathn.rb . . . no idea)?
    

Here's a link to what I'm looking at:
http://www.ruby-doc.org/stdlib/libdoc/mathn/rdoc/classes/Integer.html#M000926

Both, sort of.

ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]

irb(main):001:0> require 'mathn'
=> true
irb(main):002:0> 12.gcd(4)
=> 4

-Justin

Sorry, that should be gcd2.

-Justin

For your information gcd works with 1.9.1 but gcd2 does not. Not sure what the difference between gcd and gcd2 are and why gcd2 was dropped from mathn in 1.9.1.

···

On Jan 9, 8:32 pm, Matt <mgregor...@gmail.com> wrote:

Michael W. Ryder wrote:

Justin Collins wrote:

Justin Collins wrote:

Matt wrote:

The standard library docs don't make sense to me a lot of the time.
How do I use the gcd2 method in class Integer (or is it in file
mathn.rb . . . no idea)?
    

Here's a link to what I'm looking at:
http://www.ruby-doc.org/stdlib/libdoc/mathn/rdoc/classes/Integer.html#M000926

Both, sort of.

ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]

irb(main):001:0> require 'mathn'
=> true
irb(main):002:0> 12.gcd(4)
=> 4

-Justin

Sorry, that should be gcd2.

-Justin

For your information gcd works with 1.9.1 but gcd2 does not. Not sure what the difference between gcd and gcd2 are and why gcd2 was dropped from mathn in 1.9.1.

I don't know, exactly, either.
Here is the thread referenced by the changelog: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/7931

-Justin

···

On Jan 9, 8:32 pm, Matt <mgregor...@gmail.com> wrote: