mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[poincare] Check if Expression is Rational before casting it
This commit is contained in:
committed by
EmilieNumworks
parent
4e8cd02d3f
commit
c12b86cdd4
@@ -143,7 +143,7 @@ Expression Logarithm::shallowReduce(Context & context, Preferences::AngleUnit an
|
||||
Expression Logarithm::simpleShallowReduce(Context & context, Preferences::AngleUnit angleUnit) {
|
||||
Expression c = childAtIndex(0);
|
||||
// log(0,0)->Undefined
|
||||
if (numberOfChildren() == 2 && childAtIndex(1).type() == ExpressionNode::Type::Rational && childAtIndex(1).convert<Rational>().isZero() && static_cast<Rational &>(c).isZero()) {
|
||||
if (numberOfChildren() == 2 && c.type() == ExpressionNode::Type::Rational && childAtIndex(1).type() == ExpressionNode::Type::Rational && childAtIndex(1).convert<Rational>().isZero() && static_cast<Rational &>(c).isZero()) {
|
||||
Expression result = Undefined();
|
||||
replaceWithInPlace(result);
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user