diff --git a/poincare/include/poincare/subtraction.h b/poincare/include/poincare/subtraction.h index d07136cd0..911387bd6 100644 --- a/poincare/include/poincare/subtraction.h +++ b/poincare/include/poincare/subtraction.h @@ -3,10 +3,10 @@ #include -class Substraction : public Expression { +class Subtraction : public Expression { public: - Substraction(Expression * first_operand, Expression * second_operand); - ~Substraction(); + Subtraction(Expression * first_operand, Expression * second_operand); + ~Subtraction(); ExpressionLayout * createLayout(ExpressionLayout * parent) override; float approximate(Context& context) override; private: diff --git a/poincare/src/expression_parser.y b/poincare/src/expression_parser.y index 2b257ea29..bef087c10 100644 --- a/poincare/src/expression_parser.y +++ b/poincare/src/expression_parser.y @@ -80,7 +80,7 @@ exp: INTEGER { $$ = new Integer($1); } | SYMBOL { $$ = new Symbol($1); } | exp PLUS exp { $$ = new Addition($1,$3); } - | exp MINUS exp { $$ = new Substraction($1,$3); } + | exp MINUS exp { $$ = new Subtraction($1,$3); } | exp MULTIPLY exp { $$ = new Product($1,$3); } | exp DIVIDE exp { $$ = new Fraction($1,$3); } | exp POW exp { $$ = new Power($1,$3); } diff --git a/poincare/src/subtraction.cpp b/poincare/src/subtraction.cpp index 6010ea621..48892e7bc 100644 --- a/poincare/src/subtraction.cpp +++ b/poincare/src/subtraction.cpp @@ -1,20 +1,20 @@ #include #include "layout/horizontal_layout.h" -Substraction::Substraction(Expression * first_operand, Expression * second_operand) { +Subtraction::Subtraction(Expression * first_operand, Expression * second_operand) { m_left = first_operand; m_right = second_operand; } -Substraction::~Substraction() { +Subtraction::~Subtraction() { delete m_left; delete m_right; } -float Substraction::approximate(Context& context) { +float Subtraction::approximate(Context& context) { return m_left->approximate(context) - m_right->approximate(context); } -ExpressionLayout * Substraction::createLayout(ExpressionLayout * parent) { +ExpressionLayout * Subtraction::createLayout(ExpressionLayout * parent) { return new HorizontalLayout(parent, m_left, '-', m_right); }