Change Substraction to Subtraction.

Only changed the files name last time.

Change-Id: I85a809f9ea349e1bec771c61a18d4b5e9b491fdc
This commit is contained in:
Felix Raimundo
2016-03-22 12:38:08 +01:00
parent 5f86659bd3
commit 3c514a78e0
3 changed files with 8 additions and 8 deletions

View File

@@ -3,10 +3,10 @@
#include <poincare/expression.h>
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:

View File

@@ -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); }

View File

@@ -1,20 +1,20 @@
#include <poincare/subtraction.h>
#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);
}