diff --git a/apps/i18n.h b/apps/i18n.h index 0a40b43f1..13d28447a 100644 --- a/apps/i18n.h +++ b/apps/i18n.h @@ -41,7 +41,7 @@ namespace I18n { Product, ComplexAbsoluteValue, Agument, - ReelPart, + RealPart, ImaginaryPart, Conjugate, Combination, diff --git a/apps/math_toolbox.cpp b/apps/math_toolbox.cpp index ea120c032..53fa83839 100644 --- a/apps/math_toolbox.cpp +++ b/apps/math_toolbox.cpp @@ -8,7 +8,7 @@ * subtree, the edited text is set at I18n::Message::Default. */ const ToolboxNode calculChildren[4] = {ToolboxNode(I18n::Message::DiffCommandWithArg, I18n::Message::DerivateNumber, I18n::Message::DiffCommand), ToolboxNode(I18n::Message::IntCommandWithArg, I18n::Message::Integral, I18n::Message::IntCommand), ToolboxNode(I18n::Message::SumCommandWithArg, I18n::Message::Sum, I18n::Message::SumCommand), ToolboxNode(I18n::Message::ProductCommandWithArg, I18n::Message::Product, I18n::Message::ProductCommand)}; -const ToolboxNode complexChildren[5] = {ToolboxNode(I18n::Message::AbsCommandWithArg, I18n::Message::ComplexAbsoluteValue, I18n::Message::AbsCommand), ToolboxNode(I18n::Message::ArgCommandWithArg, I18n::Message::Agument, I18n::Message::ArgCommand), ToolboxNode(I18n::Message::ReCommandWithArg, I18n::Message::ReelPart, I18n::Message::ReCommand), ToolboxNode(I18n::Message::ImCommandWithArg, I18n::Message::ImaginaryPart, I18n::Message::ImCommand), ToolboxNode(I18n::Message::ConjCommandWithArg, I18n::Message::Conjugate, I18n::Message::ConjCommand)}; +const ToolboxNode complexChildren[5] = {ToolboxNode(I18n::Message::AbsCommandWithArg, I18n::Message::ComplexAbsoluteValue, I18n::Message::AbsCommand), ToolboxNode(I18n::Message::ArgCommandWithArg, I18n::Message::Agument, I18n::Message::ArgCommand), ToolboxNode(I18n::Message::ReCommandWithArg, I18n::Message::RealPart, I18n::Message::ReCommand), ToolboxNode(I18n::Message::ImCommandWithArg, I18n::Message::ImaginaryPart, I18n::Message::ImCommand), ToolboxNode(I18n::Message::ConjCommandWithArg, I18n::Message::Conjugate, I18n::Message::ConjCommand)}; const ToolboxNode probabilityChildren[2] = {ToolboxNode(I18n::Message::BinomialCommandWithArg, I18n::Message::Combination, I18n::Message::BinomialCommand), ToolboxNode(I18n::Message::PermuteCommandWithArg, I18n::Message::Permutation, I18n::Message::PermuteCommand)}; const ToolboxNode arithmeticChildren[4] = {ToolboxNode(I18n::Message::GcdCommandWithArg, I18n::Message::GreatCommonDivisor, I18n::Message::GcdCommand),ToolboxNode(I18n::Message::LcmCommandWithArg, I18n::Message::LeastCommonMultiple, I18n::Message::LcmCommand), ToolboxNode(I18n::Message::RemCommandWithArg, I18n::Message::Remainder, I18n::Message::RemCommand), ToolboxNode(I18n::Message::QuoCommandWithArg, I18n::Message::Quotient, I18n::Message::QuoCommand)}; #if MATRICES_ARE_DEFINED diff --git a/poincare/Makefile b/poincare/Makefile index 4a86645b6..50ba8e35f 100644 --- a/poincare/Makefile +++ b/poincare/Makefile @@ -64,7 +64,7 @@ objs += $(addprefix poincare/src/,\ prediction_interval.o\ preferences.o\ product.o\ - reel_part.o\ + real_part.o\ round.o\ sequence.o\ sine.o\ diff --git a/poincare/include/poincare.h b/poincare/include/poincare.h index 2c6c768ba..49bf8ff68 100644 --- a/poincare/include/poincare.h +++ b/poincare/include/poincare.h @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/poincare/include/poincare/expression.h b/poincare/include/poincare/expression.h index 848d790eb..863cccd9d 100644 --- a/poincare/include/poincare/expression.h +++ b/poincare/include/poincare/expression.h @@ -35,7 +35,7 @@ public: AbsoluteValue, Factorial, ImaginaryPart, - ReelPart, + RealPart, ComplexArgument, Conjugate, Logarithm, diff --git a/poincare/include/poincare/reel_part.h b/poincare/include/poincare/real_part.h similarity index 95% rename from poincare/include/poincare/reel_part.h rename to poincare/include/poincare/real_part.h index 10a6d7b56..4d83f50ab 100644 --- a/poincare/include/poincare/reel_part.h +++ b/poincare/include/poincare/real_part.h @@ -7,7 +7,7 @@ namespace Poincare { -class ReelPart : public StaticHierarchy<1> { +class RealPart : public StaticHierarchy<1> { using StaticHierarchy<1>::StaticHierarchy; public: Type type() const override; diff --git a/poincare/src/expression_lexer.l b/poincare/src/expression_lexer.l index 8d637bdf3..06e26cba3 100644 --- a/poincare/src/expression_lexer.l +++ b/poincare/src/expression_lexer.l @@ -124,7 +124,7 @@ prediction95 { poincare_expression_yylval.expression = new PredictionInterval(); prediction { poincare_expression_yylval.expression = new ConfidenceInterval(); return FUNCTION; } product { poincare_expression_yylval.expression = new Product(); return FUNCTION; } quo { poincare_expression_yylval.expression = new DivisionQuotient(); return FUNCTION; } -re { poincare_expression_yylval.expression = new ReelPart(); return FUNCTION; } +re { poincare_expression_yylval.expression = new RealPart(); return FUNCTION; } rem { poincare_expression_yylval.expression = new DivisionRemainder(); return FUNCTION; } root { poincare_expression_yylval.expression = new NthRoot(); return FUNCTION; } round { poincare_expression_yylval.expression = new Round(); return FUNCTION; } diff --git a/poincare/src/real_part.cpp b/poincare/src/real_part.cpp new file mode 100644 index 000000000..791bbe28c --- /dev/null +++ b/poincare/src/real_part.cpp @@ -0,0 +1,27 @@ +#include +#include + +extern "C" { +#include +} +#include + +namespace Poincare { + +Expression::Type RealPart::type() const { + return Type::RealPart; +} + +Expression * RealPart::clone() const { + RealPart * a = new RealPart(m_operands, true); + return a; +} + +template +Complex RealPart::computeOnComplex(const Complex c, AngleUnit angleUnit) { + return Complex::Float(c.a()); +} + +} + + diff --git a/poincare/src/reel_part.cpp b/poincare/src/reel_part.cpp deleted file mode 100644 index 39a8e5bcb..000000000 --- a/poincare/src/reel_part.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include - -extern "C" { -#include -} -#include - -namespace Poincare { - -Expression::Type ReelPart::type() const { - return Type::ReelPart; -} - -Expression * ReelPart::clone() const { - ReelPart * a = new ReelPart(m_operands, true); - return a; -} - -template -Complex ReelPart::computeOnComplex(const Complex c, AngleUnit angleUnit) { - return Complex::Float(c.a()); -} - -} - - diff --git a/poincare/test/function.cpp b/poincare/test/function.cpp index eb831bc93..14c5b018c 100644 --- a/poincare/test/function.cpp +++ b/poincare/test/function.cpp @@ -35,7 +35,7 @@ QUIZ_CASE(poincare_parse_function) { assert_parsed_expression_type("prediction95(0.1, 100)", Expression::Type::PredictionInterval); assert_parsed_expression_type("product(n, 4, 10)", Expression::Type::Product); assert_parsed_expression_type("quo(29, 10)", Expression::Type::DivisionQuotient); - assert_parsed_expression_type("re(2+I)", Expression::Type::ReelPart); + assert_parsed_expression_type("re(2+I)", Expression::Type::RealPart); assert_parsed_expression_type("rem(29, 10)", Expression::Type::DivisionRemainder); assert_parsed_expression_type("root(2,3)", Expression::Type::NthRoot); assert_parsed_expression_type("R(2)", Expression::Type::SquareRoot);