kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
215 stars 37 forks source link

Add missing canonicalisation of rationals when simplifying powers #268

Closed kpeeters closed 1 year ago

kpeeters commented 1 year ago

The simplification of 1/(-a) led to an issue where the rational 1/-1 was not simplified to -1. This was due to a missing canonicalize call after generating the mpq_class with arguments (1, -1). This fixes the issue reported in https://cadabra.science/qa/2378/behavior-crashes-substituting-expression-depending-expression