[Cuis-dev] [Integrated] Re: Integer>>lcm:

Juan Vuletich juan at jvuletich.org
Fri Jun 28 06:53:30 PDT 2019

Thanks Luciano!

Now at GitHub.


On 6/27/2019 7:57 AM, Luciano Notarfrancesco via Cuis-dev wrote:
> Integer>>lcm: was defined in such a way that it could return negative 
> numbers. Also '0 lcm: 0' produced division by zero.
> The least common multiple is unique "up to units", so to make it 
> unique you have to do a consistent choice of associate (negative or 
> positive). For integers it is customary to define LCM(a,b) to be 0 if 
> a=0 or b=0, and strictly positive otherwise. This is how it is defined 
> in Magma, GAP and GMP, etc, and this change set fixes Integer>>lcm: to 
> behave like that.
> I also attach some tests for Integer>>gcd: and Integer>>lcm:.

Juan Vuletich

More information about the Cuis-dev mailing list