This is a preliminary patch. I think there is no need to call
"normalize" in hashUpdate!  ?

diff --git a/src/algebra/float.spad b/src/algebra/float.spad
index 3996e67..0f06e64 100644
--- a/src/algebra/float.spad
+++ b/src/algebra/float.spad
@@ -977,6 +977,9 @@
          (q0, q1) := (q1, q2)
          (s, t) := (t, r)

+   hashUpdate!(s : HashState, x : %) : HashState ==
+       t : RN := x.mantissa * 2::RN^x.exponent
+       hashUpdate!(s, t)

 --% Float: arbitrary precision floating point arithmetic domain

diff --git a/src/algebra/fraction.spad b/src/algebra/fraction.spad
index b4c564c..2e26261 100644
--- a/src/algebra/fraction.spad
+++ b/src/algebra/fraction.spad
@@ -280,6 +280,10 @@
     coerce(d : S) : % == [d, 1]
     zero?(x : %) == zero? x.num

+    hashUpdate!(s : HashState, x : %) ==
+        s := hashUpdate!(s, x.num)
+        s := hashUpdate!(s, x.den)
+        s

     if S has GcdDomain and S has canonicalUnitNormal then
       retract(x : %) : S ==

-- 
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