[Jprogramming] *. bug or feature?

David Mitchell davidmitchell at att.net
Thu Mar 31 21:30:29 HKT 2011


One last note, most of the references I found seem to implicitly or explicitly 
limit the domain of GCD and LCM in their definitions to positive integers.

On 3/31/2011 8:58, Raul Miller wrote:
> When I look up "least common multiple", I get definitions for its
> result like "the smallest positive integer which is a multiple of both
> numbers".
>
> Of course, that is bogus when one of the numbers is zero, and I am
> still looking for a good definition.
>
> But when one of the arguments to *. is negative, and the other is
> positive, I get a negative result instead of a positive result...  I
> think that this comes from using a definition of *%+. but is it
> correct?
>


More information about the Programming mailing list