By default Fraction always returns a gcd of 1.
(1) -> gcd(1/3,1/4)
(1) 1
Type: Fraction(Integer)
But gcd is well defined provided that the underlying domain has GcdDomain.
diff --git a/src/algebra/fraction.spad b/src/algebra/fraction.spad
index e42f0da3..fc025a9f 100644
--- a/src/algebra/fraction.spad
+++ b/src/algebra/fraction.spad
@@ -283,6 +283,7 @@ Fraction(S : IntegralDomain) : QuotientFieldCategory S with
zero?(x : %) == zero? x.num
if S has GcdDomain and S has canonicalUnitNormal then
+ gcd(x:%,y:%):% == gcd(x.num,y.num)/lcm(x.den,y.den)
x = y == (x.num = y.num) and (x.den = y.den)
hashUpdate!(s : HashState, x : %) ==
--
Is there any good reason why FriCAS should not do this? Several other
computer algebra systerms, e.g. Mathematica and Sage implement gcd in
this way.
I think it would probably also be good if gcd in Expression where
defined in this way.
--
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.