Blame view

build4/epsilon-master/poincare/src/parenthesis.cpp 1.06 KB
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  #include <poincare/parenthesis.h>
  
  extern "C" {
  #include <assert.h>
  #include <stdlib.h>
  }
  
  namespace Poincare {
  
  
  Expression::Type Parenthesis::type() const {
    return Type::Parenthesis;
  }
  
  Expression * Parenthesis::clone() const {
    Parenthesis * o = new Parenthesis(m_operands, true);
    return o;
  }
  
  int Parenthesis::polynomialDegree(char symbolName) const {
    return operand(0)->polynomialDegree(symbolName);
  }
  
  ExpressionLayout * Parenthesis::createLayout(PrintFloat::Mode floatDisplayMode, int numberOfSignificantDigits) const {
    return LayoutEngine::createParenthesedLayout(operand(0)->createLayout(floatDisplayMode, numberOfSignificantDigits), false);
  }
  
  Expression * Parenthesis::shallowReduce(Context& context, AngleUnit angleUnit) {
    Expression * e = Expression::shallowReduce(context, angleUnit);
    if (e != this) {
      return e;
    }
    return replaceWith(editableOperand(0), true);
  }
  
  template<typename T>
  Evaluation<T> * Parenthesis::templatedApproximate(Context& context, AngleUnit angleUnit) const {
    return operand(0)->privateApproximate(T(), context, angleUnit);
  }
  
  }