erlercw@siu.edu
11/15/2004 1:54:00 AM
Sorry, I forgot Integer#gcdlcm.
> def lcm(other)
> if self.zero? or other.zero?
> 0
> else
> (self.div(self.gcd(other)) * other).abs
> end
> end
def gcdlcm(other)
gcd = self.gcd(other)
if self.zero? or other.zero?
[gcd, 0]
else
[gcd, (self.div(gcd) * other).abs]
end
end