Numworks Epsilon  1.4.1
Graphing Calculator Operating System
factorial.h
Go to the documentation of this file.
1 #ifndef POINCARE_FACTORIAL_H
2 #define POINCARE_FACTORIAL_H
3 
6 
7 namespace Poincare {
8 
9 class Factorial : public StaticHierarchy<1> {
10 public:
11  Factorial(const Expression * argument, bool clone = true);
12  Type type() const override;
13  Expression * clone() const override;
14 private:
15  constexpr static int k_maxOperandValue = 100;
16  /* Layout */
17  bool needParenthesisWithParent(const Expression * e) const override;
18  ExpressionLayout * privateCreateLayout(PrintFloat::Mode floatDisplayMode, ComplexFormat complexFormat) const override;
19  int writeTextInBuffer(char * buffer, int bufferSize, int numberOfSignificantDigits = PrintFloat::k_numberOfStoredSignificantDigits) const override;
20  /* Simplication */
21  Expression * shallowReduce(Context& context, AngleUnit angleUnit) override;
22  /* Evaluation */
23  template<typename T> static Complex<T> computeOnComplex(const Complex<T> c, AngleUnit angleUnit);
24  Expression * privateApproximate(SinglePrecision p, Context& context, AngleUnit angleUnit) const override {
25  return ApproximationEngine::map<float>(this, context, angleUnit,computeOnComplex<float>);
26  }
27  Expression * privateApproximate(DoublePrecision p, Context& context, AngleUnit angleUnit) const override {
28  return ApproximationEngine::map<double>(this, context, angleUnit, computeOnComplex<double>);
29  }
30 
31 #if 0
32  int simplificationOrderGreaterType(const Expression * e) const override;
33  int simplificationOrderSameType(const Expression * e) const override;
34 #endif
35 };
36 
37 }
38 
39 #endif
Factorial(const Expression *argument, bool clone=true)
Definition: factorial.cpp:16
int simplificationOrderSameType(const Expression *e, bool canBeInterrupted) const override
c(generic_all_nodes)
Expression * clone() const override
Definition: factorial.cpp:25
Type type() const override
Definition: factorial.cpp:21