Look at the docstrings in GcdDomain. I think, we can do better.

      gcd : (%, %) -> %
            ++ gcd(x, y) returns the greatest common divisor of x and y.

      lcm : (%, %) -> %
            ++ lcm(x, y) returns the least common multiple of x and y.

In particular, it is not clearly specified what gcd(0,0) will return.
Currently gcd(0,0) in Fraction(Integer) gives 1. Why?

Because there is a default definition in Field

      gcd(x, y) == 1

In Integer, we have gcd(0,0)=0.

Mathematica, Maple, and Sage all yield 0 as a result of gcd(0,0).

I'm not saying that is the best, but 1 is also not really nice, since then

\exists a,b : gcd(x,y) = a*x + b*y

would not hold for x=y=0.

It all depends on what the definition of "greatest common divisor" in
the docstring of gcd (see above) actually is.

Opinions?

Ralf

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to