]> www.ginac.de Git - ginac.git/blobdiff - ginac/relational.cpp
* Include the operators.h header file in the source files, not in ex.h.
[ginac.git] / ginac / relational.cpp
index 3482f9096cc574d870754ea90e467c8fd1266e98..78d0b7d44fe4e06f1c80bed2aa03cc741cac3c0e 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdexcept>
 
 #include "relational.h"
+#include "operators.h"
 #include "numeric.h"
 #include "print.h"
 #include "archive.h"
@@ -249,7 +250,7 @@ unsigned relational::calchash(void) const
        unsigned lhash = lh.gethash();
        unsigned rhash = rh.gethash();
 
-       v = rotate_left_31(v);
+       v = rotate_left(v);
        switch(o) {
                case equal:
                case not_equal:
@@ -270,12 +271,9 @@ unsigned relational::calchash(void) const
                        lhash = rhash;
                        break;
        }
-       v = rotate_left_31(v);
+       v = rotate_left(v);
        v ^= lhash;
 
-       // mask out numeric hashes:
-       v &= 0x7FFFFFFFU;
-
        // store calculated hash value only if object is already evaluated
        if (flags & status_flags::evaluated) {
                setflag(status_flags::hash_calculated);
@@ -318,7 +316,7 @@ relational::safe_bool relational::make_safe_bool(bool cond) const
 relational::operator relational::safe_bool() const
 {
        const ex df = lh-rh;
-       if (!is_ex_exactly_of_type(df,numeric))
+       if (!is_exactly_a<numeric>(df))
                // cannot decide on non-numerical results
                return o==not_equal ? make_safe_bool(true) : make_safe_bool(false);