This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #32185: special case constant symbolic relations.
The mixed_order() code in sage/symbolic/comparison.pyx uses a bunch of heuristics to figure out how to compare two things. To compare (say) x and y, it creates the expression (x - y), and then looks at what type of thing (x - y) is. In most cases, this seems to work; however, when x is a symbolic constant and y is zero, the expression (x - y) reduces to just x, a symbolic constant. The mixed_order() code is not expecting this, and it fails to compare x.pyobject() to the integer zero. To work around this problem, this commit adds an additional check for whether or not (x - y) is a symbolic constant, and falls through to a numerical comparison in that case.
- Loading branch information