From: Tom Allison Date: 2006-01-17T00:12:15+09:00 Subject: Re: basic question about Fixnum & Integer Daniel Harple wrote: > > On Jan 16, 2006, at 3:50 PM, Tom Allison wrote: > >> This is too simple to get wrong? > > > You must require 'mathn' > > example: > > require 'mathn' > > 6.lcm(7) # -> 42 > > - Daniel > Thank you. This is the first I've heard of mathn, even from the Integer doc pages. I missed it. Backing up.... I was assuming that to include a module I would call the class name on the assumption that the class name matches the class file (similar to perl and java). But this isn't the case with mathn. Doing some more poking about: ri has nothing known about mathn or anything like it. ri tells me that Integer.lcm is a real method. but to invoke this method on a Fixnum, I have to require a package name that isn't mentioned in the lcm, Fixnu, or Integer docs. Granted, I found all this from the web pages for the standard library, but it wasn't intuitive. It doesn't even mention that mathn is responsible for this lcm method. This is really frustrating. Is the documentation wrong or did I just miss something that every Ruby-ite should know?