mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
Change Substraction to Subtraction.
Only changed the files name last time. Change-Id: I85a809f9ea349e1bec771c61a18d4b5e9b491fdc
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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); }
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user