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