gcdlcm(other)
public
Returns the GCD and the LCM (see #gcd and #lcm)
of the two arguments (self and other). This is more
efficient than calculating them separately.
Example:
6.gcdlcm 9
Show source
def gcdlcm(other)
gcd = self.gcd(other)
if self.zero? or other.zero?
[gcd, 0]
else
[gcd, (self.div(gcd) * other).abs]
end
end