]> www.ginac.de Git - ginac.git/blobdiff - ginac/relational.cpp
[BUGFIX] Fix crash in parser.
[ginac.git] / ginac / relational.cpp
index d050b2e65fffc14c143cccd35bfc9ddf62412ac5..8607dca905884246bd70d2e442cb6e0491f4376a 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of relations between expressions */
 
 /*
- *  GiNaC Copyright (C) 1999-2021 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2024 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -223,8 +223,8 @@ int relational::compare_same_type(const basic & other) const
                                return (o < oth.o) ? -1 : 1;
                        break;
        }
-       const int lcmpval = lh.compare(oth.rh);
-       return (lcmpval!=0) ? lcmpval : rh.compare(oth.lh);
+       const int lcmpval = lh.compare(oth.lh);
+       return (lcmpval!=0) ? lcmpval : rh.compare(oth.rh);
 }
 
 bool relational::match_same_type(const basic & other) const
@@ -308,7 +308,7 @@ relational::safe_bool relational::make_safe_bool(bool cond) const
  *  unequal or undecidable). */
 relational::operator relational::safe_bool() const
 {
-       const ex df = lh-rh;
+       const ex df = lh-rh;  // like ::canonical() method
        // We treat numeric and symbolic expression differently
        if (is_exactly_a<numeric>(df)) {
                switch (o) {