diff --git a/poincare/src/trigonometry.cpp b/poincare/src/trigonometry.cpp index be052bc81..8490c03be 100644 --- a/poincare/src/trigonometry.cpp +++ b/poincare/src/trigonometry.cpp @@ -30,7 +30,7 @@ float Trigonometry::characteristicXRange(const Expression & e, Context & context assert(d == 1); /* To compute a, the slope of the expression child(0), we compute the * derivative of child(0) for any x value. */ - Poincare::Derivative derivative(e.childAtIndex(0), Float(1.0f)); + Poincare::Derivative derivative(e.childAtIndex(0).clone(), Float(1.0f)); float a = derivative.approximateToScalar(context, angleUnit); float pi = angleUnit == Preferences::AngleUnit::Radian ? M_PI : 180.0f; return 2.0f*pi/std::fabs(a);