Numworks Epsilon  1.4.1
Graphing Calculator Operating System
complex_argument.cpp
Go to the documentation of this file.
2 #include <poincare/complex.h>
4 extern "C" {
5 #include <assert.h>
6 }
7 #include <cmath>
8 
9 namespace Poincare {
10 
12  return Type::ComplexArgument;
13 }
14 
17  return a;
18 }
19 
20 Expression * ComplexArgument::shallowReduce(Context& context, AngleUnit angleUnit) {
21  Expression * e = Expression::shallowReduce(context, angleUnit);
22  if (e != this) {
23  return e;
24  }
25 #if MATRIX_EXACT_REDUCING
26  Expression * op = editableOperand(0);
27  if (op->type() == Type::Matrix) {
28  return SimplificationEngine::map(this, context, angleUnit);
29  }
30 #endif
31  return this;
32 }
33 
34 template<typename T>
35 Complex<T> ComplexArgument::computeOnComplex(const Complex<T> c, AngleUnit angleUnit) {
36  return Complex<T>::Float(c.th());
37 }
38 
39 }
40 
Expression * clone() const override
friend class ComplexArgument
Definition: expression.h:36
c(generic_all_nodes)
Expression * editableOperand(int i)
Definition: expression.h:176
const Expression * m_operands[T]
static Complex< T > Float(T x)
Definition: complex.cpp:23
Type type() const override