mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[poincare] Rational Power: always reduce p^(-1) if p rational
Otherwise, it causes bug when trying to reduce to same denominator.
For example:
In Calculation app, type:
'6' OK,
'Y-ans/(ans*ans*ans*ans*ans), OK
OK
OK
OK
--> crash
This commit is contained in:
committed by
LeaNumworks
parent
332564318b
commit
9e0f7bedd4
@@ -821,6 +821,9 @@ bool Power::isNthRootOfUnity() const {
|
||||
}
|
||||
|
||||
bool Power::RationalExponentShouldNotBeReduced(const Rational * b, const Rational * r) {
|
||||
if (r->isMinusOne()) {
|
||||
return false;
|
||||
}
|
||||
/* We check that the simplification does not involve too complex power of
|
||||
* integers (ie 3^999, 120232323232^50) that would take too much time to
|
||||
* compute:
|
||||
|
||||
Reference in New Issue
Block a user